Example #1
0
        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);
                }
            }
        }
Example #2
0
 public BaseService()
 {
     this.Db = new ToolTrackContext();
 }
Example #3
0
 public BaseDAO()
 {
     db = new ToolTrackContext();
 }