I am using
When I use the repository , Then this library requires a specific ID. / P>
I decided that the integer no Gid.
The question now is how do I get a new integer and how do I do it?
This is my current view View Vide model in the school category. Cs:
Public School AdministrationModel () {_schoolclassRepo = New SchoolGuesage Repository (); _pupilRepo = new student repository (); _subjectRepo = New SubjectRepository (); _currentSchoolclass = New School Class Model (); _currentPupil = new student model (); _currentSubject = new thememodel ();
...
}
Private zero addSchoolclass () {// Final free ID for a school class unit _currentSchoolclass.SchoolclassID = _schoolclassRepo Get .LastID; // Add a new school class unit to the repository _schoolclassRepo.Add (School Classes Model. SchoolsCallsmodd's School Class (_currentSchoolclass)); // Add new school class units to the Observed Collection for the school class. Add (_currentSchoolclass); // Create a new school class unit and the bound UI control content is turned on CurrentSchoolclass = new school classodel (); } Public Class School Class Repository: Irpository and Lieutenant; School class & gt; {Private int_stave; Public SchoolClose Repository () {_lastID = FetchLastId (); } Add Public Zero (School Class Unit) {//repo.Store:entity); } Private Ind FetchLastId () {Return // repo.GetIDOfLastEntryAndDoInc ++} Public int LastID {get {return_lastID; Explanation: Every time the user switches to user's school class administration viewmodel, which is called DataCol as a software with userrent and the school class is created in the formatting, where FetchLastId () is called and I
Do you have any better ideas?
What I do not like about my current appetite:
- Creating a private method in the repository class because a repository is to bring data Not just counter, such as "unit logic" - to access public property from viewmodel - located in the repository - in fact, seeing MODEL is not a concern for obtaining and assigning one unit ID. Actually, ViewModel should ask for the school class POCO and a school class model should be linked to the UI. But then again I have to re-read the school class properties in the school class model properties which I want to save.
Comments
Post a Comment