public static Core.Models.Forms.DecimalField ToModel(this Entities.Forms.DecimalField entity) { return(new Core.Models.Forms.DecimalField { AllowFilter = entity.AllowFilter, IsUnique = entity.IsUnique, IsRequired = entity.IsRequired, FieldName = entity.FieldName, DisplayName = entity.DisplayName, AllowSort = entity.AllowSort, Description = entity.Description, DefaultValue = entity.DefaultValue, Max = entity.Max, Min = entity.Min }); }
public DecimalField ToModel(Entities.Forms.DecimalField entity) { string fieldType = entity.FieldType; switch (fieldType) { case FieldTypes.Decimal: return(new DecimalField { AllowFilter = entity.AllowFilter, IsUnique = entity.IsUnique, IsRequired = entity.IsRequired, FieldName = entity.FieldName, DisplayName = entity.DisplayName, AllowSort = entity.AllowSort, Description = entity.Description, DefaultValue = entity.DefaultValue, Max = entity.Max, Min = entity.Min }); } throw new InvalidOperationException($"unknown field type {fieldType}"); }