Ejemplo n.º 1
0
 public AccountViewModel(Account customer, AccountCountingModel accountCounting)
 {
     Id              = customer.Id;
     Email           = customer.Email;
     Name            = customer.Name;
     Avatar          = !string.IsNullOrEmpty(customer.Avatar) ? customer.Avatar : "account/avatar.png";
     Type            = customer.Type;
     AccountCounting = new AccountCountingViewModel(accountCounting);
 }
 public AccountCountingViewModel(AccountCountingModel model)
 {
     if (model != null)
     {
         AvgShareCount   = Math.Round(model.AvgShareCount, 2);
         AvgLikeCount    = Math.Round(model.AvgLikeCount, 2);
         AvgCommentCount = Math.Round(model.AvgCommentCount, 2);
         FriendsCount    = model.FriendsCount;
         FollowersCount  = model.FollowersCount;
     }
 }