public static async Task <ICollection <Tag> > GetTags(long id) { try { using (var ctx = new Data.AmstramgramContext()) { var pictureRepo = new Data.Repositories.PictureRepository(ctx, null); return(await pictureRepo.GetTags(id)); } } catch { return(new List <Tag>()); } }
public static Core.Models.UserFollower Find(long userId, long followerId) { try { using (var ctx = new Data.AmstramgramContext()) { var UserFollowerRepo = new Data.Repositories.UserFollowerRepository(ctx, null); return(UserFollowerRepo.Find(userId, followerId)); } } catch { return(null); } }
public static async Task <List <Core.Models.Picture> > GetAll(string include) { try { using (var ctx = new Data.AmstramgramContext()) { var pictureRepo = new Data.Repositories.PictureRepository(ctx, null); return(await pictureRepo.GetAll(include)); } } catch { return(new List <Core.Models.Picture>()); } }
public static async Task <Core.Models.Like> Get(long id, string include) { try { using (var ctx = new Data.AmstramgramContext()) { var LikeRepo = new Data.Repositories.LikeRepository(ctx, null); return(await LikeRepo.Get(id, include)); } } catch { return(null); } }
public static async Task <List <Core.Models.UserFollower> > GetAll(IEnumerable <string> includes) { try { using (var ctx = new Data.AmstramgramContext()) { var UserFollowerRepo = new Data.Repositories.UserFollowerRepository(ctx, null); return(await UserFollowerRepo.GetAll(includes)); } } catch { return(new List <Core.Models.UserFollower>()); } }
public static Core.Models.Like Find(long userId, long pictureId) { try { using (var ctx = new Data.AmstramgramContext()) { var LikeRepo = new Data.Repositories.LikeRepository(ctx, null); return(LikeRepo.Find(userId, pictureId)); } } catch { return(null); } }
public static async Task <List <Core.Models.Like> > GetAll() { try { using (var ctx = new Data.AmstramgramContext()) { var LikeRepo = new Data.Repositories.LikeRepository(ctx, null); return(await LikeRepo.GetAll()); } } catch { return(new List <Core.Models.Like>()); } }
public static async Task <Core.Models.User> GetUser(long id) { try { using (var ctx = new Data.AmstramgramContext()) { var UserFollowerRepo = new Data.Repositories.UserFollowerRepository(ctx, null); return(await UserFollowerRepo.GetUser(id)); } } catch { return(null); } }
public static async Task <Core.Models.Comment> Get(long id, IEnumerable <string> includes) { try { using (var ctx = new Data.AmstramgramContext()) { var commentRepo = new Data.Repositories.CommentRepository(ctx, null); return(await commentRepo.Get(id, includes)); } } catch { return(null); } }
public static async Task <Core.Models.Picture> GetPicture(long id) { try { using (var ctx = new Data.AmstramgramContext()) { var commentRepo = new Data.Repositories.CommentRepository(ctx, null); return(await commentRepo.GetPicture(id)); } } catch { return(null); } }
public static bool Update(Core.Models.Picture entity) { try { using (var ctx = new Data.AmstramgramContext()) { var pictureRepo = new Data.Repositories.PictureRepository(ctx, null); pictureRepo.Update(entity); return(pictureRepo.SaveChanges()); } } catch { return(false); } }
public static bool Delete(Core.Models.UserFollower entity) { try { using (var ctx = new Data.AmstramgramContext()) { var UserFollowerRepo = new Data.Repositories.UserFollowerRepository(ctx, null); UserFollowerRepo.Delete(entity); return(UserFollowerRepo.SaveChanges()); } } catch { return(false); } }
public static bool AddRange(IEnumerable <Core.Models.UserFollower> entities) { try { using (var ctx = new Data.AmstramgramContext()) { var UserFollowerRepo = new Data.Repositories.UserFollowerRepository(ctx, null); UserFollowerRepo.AddRange(entities); return(UserFollowerRepo.SaveChanges()); } } catch { return(false); } }
public static async Task <List <Core.Models.User> > GetAll(string include) { try { using (var ctx = new Data.AmstramgramContext()) { var userRepo = new Data.Repositories.UserRepository(ctx, null); var result = await userRepo.GetAll(include); return(result); } } catch { return(new List <Core.Models.User>()); } }
public static async Task <Core.Models.User> Get(long id) { try { using (var ctx = new Data.AmstramgramContext()) { var userRepo = new Data.Repositories.UserRepository(ctx, null); var result = await userRepo.Get(id); return(result); } } catch { return(null); } }
public static async Task <Core.Models.UserFollower> Get(long id, IEnumerable <string> includes) { try { using (var ctx = new Data.AmstramgramContext()) { var UserFollowerRepo = new Data.Repositories.UserFollowerRepository(ctx, null); var result = await UserFollowerRepo.Get(id, includes); return(result); } } catch { return(null); } }
public static async Task <Core.Models.Picture> Get(long id, string include) { try { using (var ctx = new Data.AmstramgramContext()) { var pictureRepo = new Data.Repositories.PictureRepository(ctx, null); var result = await pictureRepo.Get(id, include); return(result); } } catch { return(null); } }
public static async Task <ICollection <Core.Models.Picture> > GetPictures(long id) { try { using (var ctx = new Data.AmstramgramContext()) { var userRepo = new Data.Repositories.UserRepository(ctx, null); var result = await userRepo.GetPictures(id); return(result); } } catch { return(new List <Core.Models.Picture>()); } }
public static Core.Models.Picture Add(Core.Models.Picture entity) { try { using (var ctx = new Data.AmstramgramContext()) { var pictureRepo = new Data.Repositories.PictureRepository(ctx, null); var result = pictureRepo.Add(entity); if (!pictureRepo.SaveChanges()) { return(null); } return(result); } } catch { return(null); } }
public static Core.Models.UserFollower Add(Core.Models.UserFollower entity) { try { using (var ctx = new Data.AmstramgramContext()) { var UserFollowerRepo = new Data.Repositories.UserFollowerRepository(ctx, null); var result = UserFollowerRepo.Add(entity); if (!UserFollowerRepo.SaveChanges()) { return(null); } return(result); } } catch { return(null); } }