public void DeleteCommunity(CommunityItem communityItem)
        {
            var entity = new Community
            {
                CommunityID = communityItem.CommunityID
            };

            db.Communities.Attach(entity);
            db.Communities.Remove(entity);
            db.SaveChanges();
        }
        public void CreateCommunity(CommunityItem communityItem)
        {
            var entity = new Community
            {
                CommunityName = communityItem.CommunityName,
                RegionID      = communityItem.RegionID
            };

            db.Communities.Add(entity);
            db.SaveChanges();
            communityItem.CommunityID = entity.CommunityID;
        }
        public void UpdateCommunity(CommunityItem communityItem)
        {
            var entity = new Community
            {
                CommunityID   = communityItem.CommunityID,
                CommunityName = communityItem.CommunityName,
                RegionID      = communityItem.RegionID
            };

            db.Communities.Attach(entity);
            db.Entry(entity).State = EntityState.Modified;
            db.SaveChanges();
        }