Skip to content

Instantly share code, notes, and snippets.

@Boztown
Created December 20, 2013 18:34
Show Gist options
  • Save Boztown/8059261 to your computer and use it in GitHub Desktop.
Save Boztown/8059261 to your computer and use it in GitHub Desktop.
public int Save(CollectionViewModel collectionModel)
{
var collection = collectionModel.Id.HasValue ? _collectionRepository.Get(collectionModel.Id.Value) : new Collection();
collection.Name = collectionModel.Name;
collection.Published = collectionModel.Published;
collection.Featured = collectionModel.Featured;
collection.Description = collectionModel.Description;
_collectionRepository.Save(collection);
return collection.Id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment