public List <Activity_BLL_DTO> GetMyActivities(Token_BLL_DTO token) { return(null); /* Mapper.Reset(); * Mapper.Initialize(cfg => cfg.CreateMap<Activity, Activity_BLL_DTO>()); * var dest = Mapper.Map<List<Activity>, List<Activity_BLL_DTO>>(ctx.Activities.Where(x => x.Users.Where(y=>y.Login== Converter_BLL_DTO.ToToken(token).User.Login)).ToList()); * return dest;*/ }
public static Token ToToken(Token_BLL_DTO Token_BLL_DTO, DataModel context) { return(context.Tokens.FirstOrDefault(x => x.User.Login == Token_BLL_DTO.User.Login)); }
public int GetUserFollowesCount(Token_BLL_DTO token) { return(ctx.Users.FirstOrDefault(x => x.Login == token.User.Login).Folowers.Count()); }
public void Subscibe(User_BLL_DTO user, Token_BLL_DTO token) { ctx.Users.FirstOrDefault(x => x.Login == token.User.Login).Folowers.Add(Converter_BLL_DTO.ToUser(user, ctx)); ctx.SaveChanges(); }