pajo
4/18/2012 4:34:49 PM
Hi Jeremy,
You're on right track. GetNewCalendarEvent will give you only in-memory instance of new event and it will not save it in database. Also this method will ensure newEvent has all required fields and it's attached to calendar. Sometimes you don't want to save new event to persistent storage at the time of creation, you may need to validate it before saving it. To save it to database you need to use generic SaveEntity method, you just need to add this code after populating your event
repository.SaveEntity(newEvent);
If you don't have create or save method for entity you can use generic SaveEntity on any repository to save it to persistent storage.
459
Reputation
55
Total posts