示例#1
0
        public static async Task <bool> Update(TestAppEntities ctx, CustomFiles item)
        {
            ctx.Update(item);
            await ctx.SaveChangesAsync();

            return(true);
        }
示例#2
0
        public static async Task <Users> Add(TestAppEntities ctx, Users item)
        {
            ctx.Users.Add(item);
            await ctx.SaveChangesAsync();

            return(item);
        }
示例#3
0
        public static async Task <CustomFiles> Add(TestAppEntities ctx, CustomFiles item)
        {
            ctx.CustomFiles.Add(item);
            await ctx.SaveChangesAsync();

            return(item);
        }
示例#4
0
        public static async Task <bool> Delete(TestAppEntities ctx, int id)
        {
            var user_item = await ctx.CustomFiles.SingleOrDefaultAsync(m => m.customfile_id == id);

            ctx.CustomFiles.Remove(user_item);
            await ctx.SaveChangesAsync();

            return(true);
        }
示例#5
0
 public static async Task <CustomFiles> GetItem(TestAppEntities ctx, int id)
 {
     return(await(from x in ctx.CustomFiles where x.customfile_id == id select x).FirstOrDefaultAsync());
 }
示例#6
0
 public static async Task <List <CustomFiles> > GetList(TestAppEntities ctx)
 {
     return(await(from x in ctx.CustomFiles select x).ToListAsync());
 }
示例#7
0
 public static async Task <Users> GetItem(TestAppEntities ctx, string email)
 {
     return(await(from x in ctx.Users where x.email == email select x).FirstOrDefaultAsync());
 }
示例#8
0
 public static async Task <Users> GetItem(TestAppEntities ctx, int user_id)
 {
     return(await(from x in ctx.Users where x.user_id == user_id select x).FirstOrDefaultAsync());
 }
示例#9
0
 public static async Task <List <Users> > GetList(TestAppEntities ctx)
 {
     return(await(from x in ctx.Users select x).ToListAsync());
 }