public void Hydrate(Field field, FieldDTO fieldDTO) { field.EntityId = fieldDTO.EntityId; field.Name = fieldDTO.Name; field.Label = fieldDTO.Label; field.FieldType = fieldDTO.FieldType; field.Length = fieldDTO.Length; field.MinLength = fieldDTO.MinLength; field.Precision = fieldDTO.Precision; field.Scale = fieldDTO.Scale; field.KeyField = fieldDTO.KeyField; field.IsUnique = fieldDTO.IsUnique; field.IsNullable = fieldDTO.IsNullable; field.ShowInSearchResults = fieldDTO.ShowInSearchResults; field.SearchType = fieldDTO.SearchType; field.SortPriority = fieldDTO.SortPriority; field.SortDescending = fieldDTO.SortDescending; field.FieldOrder = fieldDTO.FieldOrder; field.LookupId = fieldDTO.LookupId; field.EditPageType = fieldDTO.EditPageType; field.ControllerInsertOverride = fieldDTO.ControllerInsertOverride; field.ControllerUpdateOverride = fieldDTO.ControllerUpdateOverride; field.EditPageDefault = fieldDTO.EditPageDefault; field.CalculatedFieldDefinition = fieldDTO.CalculatedFieldDefinition; }
public FieldDTO Create(Field field) { if (field == null) { return(null); } var fieldDTO = new FieldDTO(); fieldDTO.FieldId = field.FieldId; fieldDTO.EntityId = field.EntityId; fieldDTO.Name = field.Name; fieldDTO.Label = field.Label; fieldDTO.FieldType = field.FieldType; fieldDTO.Length = field.Length; fieldDTO.MinLength = field.MinLength; fieldDTO.Precision = field.Precision; fieldDTO.Scale = field.Scale; fieldDTO.KeyField = field.KeyField; fieldDTO.IsUnique = field.IsUnique; fieldDTO.IsUniqueOnHierarchy = field.IsUniqueOnHierarchy; fieldDTO.IsNullable = field.IsNullable; fieldDTO.ShowInSearchResults = field.ShowInSearchResults; fieldDTO.SearchType = field.SearchType; fieldDTO.SortPriority = field.SortPriority; fieldDTO.SortDescending = field.SortDescending; fieldDTO.FieldOrder = field.FieldOrder; fieldDTO.LookupId = field.LookupId; fieldDTO.EditPageType = field.EditPageType; fieldDTO.ControllerInsertOverride = field.ControllerInsertOverride; fieldDTO.ControllerUpdateOverride = field.ControllerUpdateOverride; fieldDTO.EditPageDefault = field.EditPageDefault; fieldDTO.CalculatedFieldDefinition = field.CalculatedFieldDefinition; fieldDTO.RegexValidation = field.RegexValidation; fieldDTO.Lookup = Create(field.Lookup); fieldDTO.Entity = Create(field.Entity); return(fieldDTO); }