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