public Repository(ToolTrackContext context) { this.Context = context; Columns = new Dictionary <string, ColumnAttribute>(); var tableAttr = (TableAttribute)Attribute.GetCustomAttribute(TypeEntity, typeof(TableAttribute)); TableName = tableAttr != null ? tableAttr.Name : string.Empty; List <PropertyInfo> listProperties = TypeEntity.GetProperties().ToList(); foreach (var pi in listProperties) { var columnAttr = (ColumnAttribute)Attribute.GetCustomAttribute(pi, typeof(ColumnAttribute)); if (columnAttr != null) { Columns.Add(pi.Name, columnAttr); } } }
public BaseService() { this.Db = new ToolTrackContext(); }
public BaseDAO() { db = new ToolTrackContext(); }