public ClassViewModel Build(Class @class) { return new ClassViewModel() { Id = @class.Id, Name = @class.Name, PluralizedName = @class.PluralizedName, IsStandalone = @class.IsStandalone == true }; }
public Class Map(CreateOrEditViewModel createOrEdit) { Class @class = new Class(); if (createOrEdit.Id != null) @class = this.handler.Storage.GetRepository<IClassRepository>().WithKey((int)createOrEdit.Id); @class.Name = createOrEdit.Name; @class.PluralizedName = createOrEdit.PluralizedName; @class.IsStandalone = createOrEdit.IsStandalone ? true : (bool?)null; @class.ViewName = createOrEdit.ViewName; return @class; }