Example #1
0
        public void EditBlogRecord(BlogDataModel model)
        {
            dbContext = new RockstarDBModelDataContext();
            BlogTbl     oldBlogItem = dbContext.BlogTbls.Where(o => o.Id == model.Id).FirstOrDefault();
            BlogFileTbl oldBlogFile = dbContext.BlogFileTbls.Where(f => f.BlogId == model.Id).FirstOrDefault();
            DateTime    now         = DateTime.UtcNow;
            DateTime    localNow    = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);

            oldBlogItem.BlogTitle   = model.BlogTitle;
            oldBlogItem.BlogContent = model.BlogContent;
            oldBlogItem.DateCreated = localNow;


            if (model.FileContent != null)
            {
                byte[] firstUploadFile = new byte[model.FileContent.InputStream.Length];
                model.FileContent.InputStream.Read(firstUploadFile, 0, firstUploadFile.Length);

                oldBlogFile.FileTitle = model.FileContent.FileName;
                oldBlogFile.FileData  = firstUploadFile;
                oldBlogFile.BlogId    = oldBlogItem.Id;
            }


            dbContext.SubmitChanges();
        }
Example #2
0
        public void EditBlogRecord(BlogDataModel model)
        {
            dbContext = new RockstarDBModelDataContext();
            BlogTbl oldBlogItem = dbContext.BlogTbls.Where(o => o.Id == model.Id).FirstOrDefault();
            BlogFileTbl oldBlogFile = dbContext.BlogFileTbls.Where(f => f.BlogId == model.Id).FirstOrDefault();
            DateTime now = DateTime.UtcNow;
            DateTime localNow = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);

            oldBlogItem.BlogTitle = model.BlogTitle;
            oldBlogItem.BlogContent = model.BlogContent;
            oldBlogItem.DateCreated = localNow;


            if (model.FileContent != null)
            {
                byte[] firstUploadFile = new byte[model.FileContent.InputStream.Length];
                model.FileContent.InputStream.Read(firstUploadFile, 0, firstUploadFile.Length);

                oldBlogFile.FileTitle = model.FileContent.FileName;
                oldBlogFile.FileData = firstUploadFile;
                oldBlogFile.BlogId = oldBlogItem.Id;
            }


            dbContext.SubmitChanges();
        }
        /// <summary>
        /// Creates a new user profile entry
        /// </summary>
        /// <param name="model"></param>
        /// <param name="file"></param>
        /// <param name="popupFile"></param>
        public void CreateProfileEntry(RockstarProfile model, HttpPostedFileBase file, HttpPostedFileBase popupFile)
        {
            dbContext = new RockstarDBModelDataContext();
            RockstarProfile dbModel = model;
            DateTime now = DateTime.UtcNow;
            DateTime localNow = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);
            if (file != null)
            {
                byte[] fileData = new byte[file.InputStream.Length];
                file.InputStream.Read(fileData, 0, fileData.Length);

                dbModel.ProfilePic = fileData;
            }

            if (popupFile != null)
            {
                byte[] popupData = new byte[popupFile.InputStream.Length];
                popupFile.InputStream.Read(popupData, 0, popupData.Length);

                dbModel.PopupLayout = popupData;
            }

            dbModel.CreatedOn = localNow;
            dbContext.RockstarProfiles.InsertOnSubmit(dbModel);
            dbContext.SubmitChanges();
        }
Example #4
0
        /// <summary>
        /// Creates a new user profile entry
        /// </summary>
        /// <param name="model"></param>
        /// <param name="file"></param>
        /// <param name="popupFile"></param>
        public void CreateProfileEntry(RockstarProfile model, HttpPostedFileBase file, HttpPostedFileBase popupFile)
        {
            dbContext = new RockstarDBModelDataContext();
            RockstarProfile dbModel  = model;
            DateTime        now      = DateTime.UtcNow;
            DateTime        localNow = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);

            if (file != null)
            {
                byte[] fileData = new byte[file.InputStream.Length];
                file.InputStream.Read(fileData, 0, fileData.Length);

                dbModel.ProfilePic = fileData;
            }

            if (popupFile != null)
            {
                byte[] popupData = new byte[popupFile.InputStream.Length];
                popupFile.InputStream.Read(popupData, 0, popupData.Length);

                dbModel.PopupLayout = popupData;
            }

            dbModel.CreatedOn = localNow;
            dbContext.RockstarProfiles.InsertOnSubmit(dbModel);
            dbContext.SubmitChanges();
        }
Example #5
0
        public void CreateBlogEntry(BlogDataModel model)
        {
            dbContext = new RockstarDBModelDataContext();
            BlogTbl blogTbl = new BlogTbl();
            BlogFileTbl blogFileTbl = new BlogFileTbl();
            DateTime now = DateTime.UtcNow;
            DateTime localNow = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);

            blogTbl.BlogTitle = model.BlogTitle;
            blogTbl.BlogContent = model.BlogContent;
            blogTbl.DateCreated = localNow;

            dbContext.BlogTbls.InsertOnSubmit(blogTbl);
            dbContext.SubmitChanges();

            if (model.FileContent != null)
            {
                byte[] firstUploadFile = new byte[model.FileContent.InputStream.Length];
                model.FileContent.InputStream.Read(firstUploadFile, 0, firstUploadFile.Length);

                blogFileTbl.FileTitle = model.FileContent.FileName;
                blogFileTbl.FileData = firstUploadFile;
                blogFileTbl.BlogId = blogTbl.Id;
                dbContext.BlogFileTbls.InsertOnSubmit(blogFileTbl);
                dbContext.SubmitChanges();
            }
        }
Example #6
0
        public void CreateBlogEntry(BlogDataModel model)
        {
            dbContext = new RockstarDBModelDataContext();
            BlogTbl     blogTbl     = new BlogTbl();
            BlogFileTbl blogFileTbl = new BlogFileTbl();
            DateTime    now         = DateTime.UtcNow;
            DateTime    localNow    = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);

            blogTbl.BlogTitle   = model.BlogTitle;
            blogTbl.BlogContent = model.BlogContent;
            blogTbl.DateCreated = localNow;

            dbContext.BlogTbls.InsertOnSubmit(blogTbl);
            dbContext.SubmitChanges();

            if (model.FileContent != null)
            {
                byte[] firstUploadFile = new byte[model.FileContent.InputStream.Length];
                model.FileContent.InputStream.Read(firstUploadFile, 0, firstUploadFile.Length);

                blogFileTbl.FileTitle = model.FileContent.FileName;
                blogFileTbl.FileData  = firstUploadFile;
                blogFileTbl.BlogId    = blogTbl.Id;
                dbContext.BlogFileTbls.InsertOnSubmit(blogFileTbl);
                dbContext.SubmitChanges();
            }
        }
 /// <summary>
 /// Returns all User profiles
 /// </summary>
 /// <returns></returns>
 public List<RockstarProfile> ReadAllProfiles()
 {
     dbContext = new RockstarDBModelDataContext();
     List<RockstarProfile> model = (from b in dbContext.RockstarProfiles
                            select b).ToList();
     return model;
 }
Example #8
0
        public List <BlogFileTbl> ReadAllBlogFiles()
        {
            dbContext = new RockstarDBModelDataContext();
            List <BlogFileTbl> list = (from f in dbContext.BlogFileTbls
                                       select f).ToList();

            return(list);
        }
Example #9
0
        /// <summary>
        /// Returns all User profiles
        /// </summary>
        /// <returns></returns>
        public List <RockstarProfile> ReadAllProfiles()
        {
            dbContext = new RockstarDBModelDataContext();
            List <RockstarProfile> model = (from b in dbContext.RockstarProfiles
                                            select b).ToList();

            return(model);
        }
Example #10
0
        public List<BlogFileTbl> ReadAllBlogFiles()
        {
            dbContext = new RockstarDBModelDataContext();
            List<BlogFileTbl> list = (from f in dbContext.BlogFileTbls
                                      select f).ToList();

            return list;
        }
Example #11
0
        public List<BlogTbl> ReadAllBlogItems()
        {
            dbContext = new RockstarDBModelDataContext();
            List<BlogTbl> model = (from b in dbContext.BlogTbls
                                   select b).ToList();

            return model;
        }
Example #12
0
        public List <BlogTbl> ReadAllBlogItems()
        {
            dbContext = new RockstarDBModelDataContext();
            List <BlogTbl> model = (from b in dbContext.BlogTbls
                                    select b).ToList();

            return(model);
        }
 /// <summary>
 /// Returns profile by id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public RockstarProfile ReadProfileByID(int id)
 {
     dbContext = new RockstarDBModelDataContext();
     RockstarProfile model = (from b in dbContext.RockstarProfiles
                      where b.Id == id
                      select b).FirstOrDefault();
     return model;
 }
Example #14
0
        public void DeleteBlogRecord(int id)
        {
            dbContext = new RockstarDBModelDataContext();
            RockstarProfile profileItem = dbContext.RockstarProfiles.Where(p => p.Id == id).FirstOrDefault();

            dbContext.RockstarProfiles.DeleteOnSubmit(profileItem);
            dbContext.SubmitChanges();
        }
Example #15
0
        /// <summary>
        /// Returns profile by id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public RockstarProfile ReadProfileByID(int id)
        {
            dbContext = new RockstarDBModelDataContext();
            RockstarProfile model = (from b in dbContext.RockstarProfiles
                                     where b.Id == id
                                     select b).FirstOrDefault();

            return(model);
        }
Example #16
0
        public BlogTbl ReadBlogItemByID(int id)
        {
            dbContext = new RockstarDBModelDataContext();
            BlogTbl model = (from b in dbContext.BlogTbls
                             where b.Id == id
                             select b).FirstOrDefault();

            return(model);
        }
Example #17
0
        /// <summary>
        /// Returns profile by search text
        /// </summary>
        /// <param name="searchText"></param>
        /// <returns></returns>
        public List <RockstarProfile> ProfileSearch(string searchText)
        {
            dbContext = new RockstarDBModelDataContext();
            List <RockstarProfile>        list       = new List <RockstarProfile>();
            IEnumerable <RockstarProfile> collection = (from p in dbContext.RockstarProfiles
                                                        where p.FirstName == searchText || p.LastName == searchText ||
                                                        p.Hometown == searchText || p.Program == searchText
                                                        select p);

            return(collection.ToList());
        }
 public List<ProfileData>ReadProfileData()
 {
     dbContext = new RockstarDBModelDataContext();
     List<ProfileData> model = (from b in dbContext.RockstarProfiles
                                select new ProfileData
                                {
                                    ProfilePicture = b.ProfilePic.ToArray(),
                                    PopupLayoutImage = b.PopupLayout.ToArray(),
                                    YoutubeLink = b.YoutubeLink
                                }).ToList();
     return model;
 }
Example #19
0
        public BlogDataModel ReadBlogModelItemByID(int id)
        {
            dbContext = new RockstarDBModelDataContext();
            BlogDataModel model = (from b in dbContext.BlogTbls
                                   where b.Id == id
                                   select new BlogDataModel
            {
                BlogTitle = b.BlogTitle,
                BlogContent = b.BlogContent
            }).FirstOrDefault();

            return(model);
        }
Example #20
0
        public List <ProfileData> ReadProfileData()
        {
            dbContext = new RockstarDBModelDataContext();
            List <ProfileData> model = (from b in dbContext.RockstarProfiles
                                        select new ProfileData
            {
                ProfilePicture = b.ProfilePic.ToArray(),
                PopupLayoutImage = b.PopupLayout.ToArray(),
                YoutubeLink = b.YoutubeLink
            }).ToList();

            return(model);
        }
Example #21
0
        /// <summary>
        /// Update profile record
        /// </summary>
        /// <param name="model"></param>
        /// <param name="file"></param>
        /// <param name="popupFile"></param>
        public void EditProfileRecord(RockstarProfile model, HttpPostedFileBase file, HttpPostedFileBase popupFile)
        {
            dbContext = new RockstarDBModelDataContext();
            RockstarProfile oldProfile = dbContext.RockstarProfiles.Where(o => o.Id == model.Id).FirstOrDefault();
            DateTime        now        = DateTime.UtcNow;
            DateTime        localNow   = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);

            // Profile parameters
            oldProfile.FirstName              = model.FirstName;
            oldProfile.LastName               = model.LastName;
            oldProfile.DOB                    = model.DOB;
            oldProfile.UniversityCollege      = model.UniversityCollege;
            oldProfile.Program                = model.Program;
            oldProfile.GradYear               = model.GradYear;
            oldProfile.Hometown               = model.Hometown;
            oldProfile.Organization           = model.Organization;
            oldProfile.Title                  = model.Title;
            oldProfile.Associates             = model.Associates;
            oldProfile.Email                  = model.Email;
            oldProfile.Twitter                = model.Twitter;
            oldProfile.Facebook               = model.Facebook;
            oldProfile.Phone                  = model.Phone;
            oldProfile.LinkedIn               = model.LinkedIn;
            oldProfile.Instagram              = model.Instagram;
            oldProfile.Skype                  = model.Skype;
            oldProfile.PositiveChangeQuestion = model.PositiveChangeQuestion;
            oldProfile.LearnQuestion          = model.LearnQuestion;
            oldProfile.ExampleQuestion        = model.ExampleQuestion;
            oldProfile.ImpactQuestion         = model.ImpactQuestion;
            oldProfile.AdditonalQuestion      = model.AdditonalQuestion;
            oldProfile.YoutubeLink            = model.YoutubeLink;

            //File info save
            if (file != null)
            {
                byte[] fileData = new byte[file.InputStream.Length];
                file.InputStream.Read(fileData, 0, fileData.Length);
                oldProfile.ProfilePic = fileData;
            }

            if (popupFile != null)
            {
                byte[] popupData = new byte[popupFile.InputStream.Length];
                popupFile.InputStream.Read(popupData, 0, popupData.Length);

                oldProfile.PopupLayout = popupData;
            }

            oldProfile.CreatedOn = localNow;
            dbContext.SubmitChanges();
        }
Example #22
0
        public void DeleteBlogRecord(int id)
        {
            dbContext = new RockstarDBModelDataContext();

            BlogTbl            blogItem = dbContext.BlogTbls.Where(b => b.Id == id).FirstOrDefault();
            List <BlogFileTbl> blogFile = dbContext.BlogFileTbls.Where(f => f.BlogId == id).ToList();

            foreach (BlogFileTbl item in blogFile)
            {
                dbContext.BlogFileTbls.DeleteOnSubmit(item);
                dbContext.SubmitChanges();
            }
            dbContext.BlogTbls.DeleteOnSubmit(blogItem);
            dbContext.SubmitChanges();
        }
        /// <summary>
        /// Update profile record
        /// </summary>
        /// <param name="model"></param>
        /// <param name="file"></param>
        /// <param name="popupFile"></param>
        public void EditProfileRecord(RockstarProfile model, HttpPostedFileBase file, HttpPostedFileBase popupFile)
        {
            dbContext = new RockstarDBModelDataContext();
            RockstarProfile oldProfile = dbContext.RockstarProfiles.Where(o => o.Id == model.Id).FirstOrDefault();
            DateTime now = DateTime.UtcNow;
            DateTime localNow = TimeZoneInfo.ConvertTimeFromUtc(now, TimeZoneInfo.Local);

            // Profile parameters
            oldProfile.FirstName = model.FirstName;
            oldProfile.LastName = model.LastName;
            oldProfile.DOB = model.DOB;
            oldProfile.UniversityCollege = model.UniversityCollege;
            oldProfile.Program = model.Program;
            oldProfile.GradYear = model.GradYear;
            oldProfile.Hometown = model.Hometown;
            oldProfile.Organization = model.Organization;
            oldProfile.Title = model.Title;
            oldProfile.Associates = model.Associates;
            oldProfile.Email = model.Email;
            oldProfile.Twitter = model.Twitter;
            oldProfile.Facebook = model.Facebook;
            oldProfile.Phone = model.Phone;
            oldProfile.LinkedIn = model.LinkedIn;
            oldProfile.Instagram = model.Instagram;
            oldProfile.Skype = model.Skype;
            oldProfile.PositiveChangeQuestion = model.PositiveChangeQuestion;
            oldProfile.LearnQuestion = model.LearnQuestion;
            oldProfile.ExampleQuestion = model.ExampleQuestion;
            oldProfile.ImpactQuestion = model.ImpactQuestion;
            oldProfile.AdditonalQuestion = model.AdditonalQuestion;
            oldProfile.YoutubeLink = model.YoutubeLink;

            //File info save
            if (file != null)
            {
                byte[] fileData = new byte[file.InputStream.Length];
                file.InputStream.Read(fileData, 0, fileData.Length);
                oldProfile.ProfilePic = fileData;
            }

            if (popupFile != null)
            {
                byte[] popupData = new byte[popupFile.InputStream.Length];
                popupFile.InputStream.Read(popupData, 0, popupData.Length);

                oldProfile.PopupLayout = popupData;
            }

            oldProfile.CreatedOn = localNow;
            dbContext.SubmitChanges();
        }
Example #24
0
 public BlogTbl ReadBlogItemByID(int id)
 {
     dbContext = new RockstarDBModelDataContext();
     BlogTbl model = (from b in dbContext.BlogTbls
                      where b.Id == id
                      select b).FirstOrDefault();
     return model;
 }
Example #25
0
        public void CreateUser(InvolvedModel model)
        {
            dbContext = new RockstarDBModelDataContext();

            RegisteredUser userTbl = new RegisteredUser();
            UserFile fileTbl = new UserFile();

            userTbl.FirstName = model.FirstName;
            userTbl.LastName = model.LastName;
            userTbl.EmailAddress = model.EmailAddress;
            userTbl.PhoneNumber = model.PhoneNumber;
            userTbl.Facebook = model.Facebook;
            userTbl.Twitter = model.Twitter;
            userTbl.LinkedIn = model.LinkedIn;
            userTbl.Instagram = model.Instagram;
            userTbl.Skype = model.Skype;


            userTbl.CompanyProjName = model.CompanyProjName;
            userTbl.CompanyProjDescription = model.CompanyProjDescription;
            userTbl.QuantifiableMetrics = model.QuantifiableMetrics;

            userTbl.ImpactQuestion = model.ImpactQuestion;
            userTbl.ExampleQuestion = model.ExampleQuestion;
            userTbl.LearnQuestion = model.LearnQuestion;
            userTbl.AdditionalInfo = model.AdditionalInfo;

            userTbl.CreatedOn = DateTime.Now;

            dbContext.RegisteredUsers.InsertOnSubmit(userTbl);
            dbContext.SubmitChanges();

            if (model.FirstFile != null)
            {
                byte[] firstUploadFile = new byte[model.FirstFile.InputStream.Length];
                model.FirstFile.InputStream.Read(firstUploadFile, 0, firstUploadFile.Length);
                fileTbl.FileName = model.FirstFile.FileName;
                fileTbl.FileData = firstUploadFile;
                fileTbl.UserID = userTbl.Id;

                dbContext.UserFiles.InsertOnSubmit(fileTbl);
                dbContext.SubmitChanges(); ;
            }


            if (model.SecondFile != null)
            {
                byte[] secondUploadFile = new byte[model.SecondFile.InputStream.Length];
                model.SecondFile.InputStream.Read(secondUploadFile, 0, secondUploadFile.Length);
                fileTbl.FileName = model.FirstFile.FileName;
                fileTbl.UserID = userTbl.Id;
                fileTbl.FileData = secondUploadFile;
            }


            if (model.ThirdFile != null)
            {
                byte[] secondUploadFile = new byte[model.SecondFile.InputStream.Length];
                model.SecondFile.InputStream.Read(secondUploadFile, 0, secondUploadFile.Length);
                fileTbl.FileName = model.FirstFile.FileName;
                fileTbl.UserID = userTbl.Id;
                fileTbl.FileData = secondUploadFile;
            }
        }
 public void DeleteBlogRecord(int id)
 {
     dbContext = new RockstarDBModelDataContext();
     RockstarProfile profileItem = dbContext.RockstarProfiles.Where(p => p.Id == id).FirstOrDefault();
     dbContext.RockstarProfiles.DeleteOnSubmit(profileItem);
     dbContext.SubmitChanges();
 }
Example #27
0
        public void DeleteBlogRecord(int id)
        {
            dbContext = new RockstarDBModelDataContext();

            BlogTbl blogItem = dbContext.BlogTbls.Where(b => b.Id == id).FirstOrDefault();
            List<BlogFileTbl> blogFile = dbContext.BlogFileTbls.Where(f => f.BlogId == id).ToList();
            foreach (BlogFileTbl item in blogFile)
            {
                dbContext.BlogFileTbls.DeleteOnSubmit(item);
                dbContext.SubmitChanges();
            }
            dbContext.BlogTbls.DeleteOnSubmit(blogItem);
            dbContext.SubmitChanges();


        }
 /// <summary>
 /// Returns profile by search text
 /// </summary>
 /// <param name="searchText"></param>
 /// <returns></returns>
 public List<RockstarProfile> ProfileSearch(string searchText)
 {
     dbContext = new RockstarDBModelDataContext();
     List<RockstarProfile> list = new List<RockstarProfile>();
     IEnumerable<RockstarProfile> collection = (from p in dbContext.RockstarProfiles
                                                where p.FirstName == searchText || p.LastName == searchText ||
                                                p.Hometown == searchText || p.Program == searchText
                                                select p);
     return collection.ToList();
 }
Example #29
0
        public void CreateUser(InvolvedModel model)
        {
            dbContext = new RockstarDBModelDataContext();

            RegisteredUser userTbl = new RegisteredUser();
            UserFile       fileTbl = new UserFile();

            userTbl.FirstName    = model.FirstName;
            userTbl.LastName     = model.LastName;
            userTbl.EmailAddress = model.EmailAddress;
            userTbl.PhoneNumber  = model.PhoneNumber;
            userTbl.Facebook     = model.Facebook;
            userTbl.Twitter      = model.Twitter;
            userTbl.LinkedIn     = model.LinkedIn;
            userTbl.Instagram    = model.Instagram;
            userTbl.Skype        = model.Skype;


            userTbl.CompanyProjName        = model.CompanyProjName;
            userTbl.CompanyProjDescription = model.CompanyProjDescription;
            userTbl.QuantifiableMetrics    = model.QuantifiableMetrics;

            userTbl.ImpactQuestion  = model.ImpactQuestion;
            userTbl.ExampleQuestion = model.ExampleQuestion;
            userTbl.LearnQuestion   = model.LearnQuestion;
            userTbl.AdditionalInfo  = model.AdditionalInfo;

            userTbl.CreatedOn = DateTime.Now;

            dbContext.RegisteredUsers.InsertOnSubmit(userTbl);
            dbContext.SubmitChanges();

            if (model.FirstFile != null)
            {
                byte[] firstUploadFile = new byte[model.FirstFile.InputStream.Length];
                model.FirstFile.InputStream.Read(firstUploadFile, 0, firstUploadFile.Length);
                fileTbl.FileName = model.FirstFile.FileName;
                fileTbl.FileData = firstUploadFile;
                fileTbl.UserID   = userTbl.Id;

                dbContext.UserFiles.InsertOnSubmit(fileTbl);
                dbContext.SubmitChanges();;
            }


            if (model.SecondFile != null)
            {
                byte[] secondUploadFile = new byte[model.SecondFile.InputStream.Length];
                model.SecondFile.InputStream.Read(secondUploadFile, 0, secondUploadFile.Length);
                fileTbl.FileName = model.FirstFile.FileName;
                fileTbl.UserID   = userTbl.Id;
                fileTbl.FileData = secondUploadFile;
            }


            if (model.ThirdFile != null)
            {
                byte[] secondUploadFile = new byte[model.SecondFile.InputStream.Length];
                model.SecondFile.InputStream.Read(secondUploadFile, 0, secondUploadFile.Length);
                fileTbl.FileName = model.FirstFile.FileName;
                fileTbl.UserID   = userTbl.Id;
                fileTbl.FileData = secondUploadFile;
            }
        }
Example #30
0
        public BlogDataModel ReadBlogModelItemByID(int id)
        {
            dbContext = new RockstarDBModelDataContext();
            BlogDataModel model = (from b in dbContext.BlogTbls
                                   where b.Id == id
                                   select new BlogDataModel
                                   {
                                       BlogTitle = b.BlogTitle,
                                       BlogContent = b.BlogContent


                                   }).FirstOrDefault();
            return model;
        }