Exemplo n.º 1
0
 public object GetSampleAdInformation(SelectAdsByFilter_Result c)
 {
     return(new
     {
         Id = c.Id,
         Title = c.Title,
         Description = c.Description,
         Price = c.Price.ToString(),
         UserName = c.UserCreated_UserName,
         CreatedDate = DateService.GetDateByCulture(c.CreateDateTime),
         CommentsCount = c.CommentsCount.Value,
         FavoritesCount = c.FavoritesCount,
     });
 }
Exemplo n.º 2
0
        //Get User Logins
        public object GetUserLogins(string id, int take, int skip)
        {
            var User = db.Users.Find(id);

            if (User == null)
            {
                return(new ResponseVM(RequestTypeEnumVM.Error, Token.UserNotFound));
            }

            var UserLogins = User.UserLogins.OrderByDescending(c => c.Id).Skip(skip).Take(take).ToList();

            if (UserLogins.Count == 0)
            {
                if (skip == 0)
                {
                    return(new ResponseVM(RequestTypeEnumVM.Info, Token.NoResult));
                }
                return(new ResponseVM(RequestTypeEnumVM.Info, Token.NoResultMore));
            }
            return(new ResponseVM(RequestTypeEnumVM.Success, Token.Success, UserLogins.Select(x => new { x.Id, x.User.FullName, x.User.UserName, x.IsSuccess, LoginDate = DateService.GetDateByCulture(x.LoginDate) })));
        }