private AddedColumnModel MapToModel(AddedColumn entity) { AddedColumnModel model = new AddedColumnModel(); model.ID = entity.ID; model.ColumnName = entity.ColumnName; model.ColumnType = entity.ColumnType; model.EntityName = entity.EntityName; return(model); }
public async Task <ResultModel <AddedColumnModel> > Create(AddedColumnCreateModel model) { try { AddedColumn entity = MapToEntity(model); entity = await _addedColumn.Add(entity); await _addedColumn.Commit(); AddedColumnModel returnModel = MapToModel(entity); return(ResultModel <AddedColumnModel> .GetSuccessResult(returnModel)); } catch (Exception e) { await _addedColumn.Abort(); ResultErrorModel error = new ResultErrorModel(e); return(ResultModel <AddedColumnModel> .GetExceptionResult(error)); } }