Storing Data in Custom Class

Total Post:13

Points:91
C#
 444  View(s)
Ratings:
Rate this:

I am facing problem in storing data in custom class property

 public class DashboardModel

    {

        public long TotalArticle { get; set; }
        public long UnApprovedArticle { get; set; }
        public long TotalBlog { get; set; }
        public long UnApprovedBlog { get; set; }
        public long TotalUser { get; set; }
        public long LockedUser { get; set; }

    }
  1. Post:52

    Points:366
    Re: Storing Data in Custom Class

     DashboardModel model = new DashboardModel
    
                {
                    TotalArticle = _uow.Articles().Select(f => f.ID).Count(),
                    UnApprovedArticle = _uow.Articles().Where(x => !x.IsApproved).Count(),
                    TotalBlog = _uow.Blogs().Select(f => f.ID).Count(),
                    UnApprovedBlog = _uow.Blogs().Where(x => !x.IsApproved).Count(),
                    TotalUser = _uow.MindstickUsers(type).Count(),
                    LockedUser = _uow.MindstickUsers(type).Where(x => !x.IsActive ?? true).Count()

                };

    you can use custome class like this..hope it help you..



Answer