internal static ScaleModelProjectType ConvertToEntity(this ScaleModelProjectTypeDataModel model) { return(new ScaleModelProjectType() { Id = model.Id, TypeName = model.TypeName }); }
internal static ResponseEnvelope CreateEntity(ScaleModelProjectTypeDataModel model) { ScaleModelProjectType entity = model.ConvertToEntity(); entity.DateCreated = DateTime.Now; entity.DateLastModified = DateTime.Now; return(ScaleModelProjectTypeManager.Create(entity)); }
internal static ResponseEnvelope DeleteEntity(ScaleModelProjectTypeDataModel model) { if (model == null) { return(new ResponseEnvelope(new Exception("Parameter 'model' is empty"))); } ScaleModelProjectType entity = ScaleModelProjectTypeManager.GetEntityFromGuid(model.Id); return(ScaleModelProjectTypeManager.Delete(entity)); }
internal static ResponseEnvelope UpdateEntity(ScaleModelProjectTypeDataModel model) { if (model == null) { return(new ResponseEnvelope(new Exception("Parameter 'model' is empty"))); } ScaleModelProjectType entity = ScaleModelProjectTypeManager.GetEntityFromGuid(model.Id); entity.UpdateFromModel(model); entity.DateLastModified = DateTime.Now; return(ScaleModelProjectTypeManager.Update()); }
internal static void UpdateFromModel(this ScaleModelProjectType entity, ScaleModelProjectTypeDataModel model) { entity.Id = model.Id; entity.TypeName = model.TypeName; }