当前位置: 首页>>代码示例>>C#>>正文


C# MainDb.Entry方法代码示例

本文整理汇总了C#中SO.SilList.Manager.DbContexts.MainDb.Entry方法的典型用法代码示例。如果您正苦于以下问题:C# MainDb.Entry方法的具体用法?C# MainDb.Entry怎么用?C# MainDb.Entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SO.SilList.Manager.DbContexts.MainDb的用法示例。


在下文中一共展示了MainDb.Entry方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: update

        public ListingVo update(ListingVo input, Guid? listingId= null)
        {
            using (var db = new MainDb())
            {

                if (listingId == null)
                    listingId = input.listingId;

                var res = db.listings.FirstOrDefault(e => e.listingId == listingId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:ListingManagerBase.cs

示例2: update

        public StateTypeVo update(StateTypeVo input, int? stateTypeId= null)
        {
            using (var db = new MainDb())
            {

                if (stateTypeId == null)
                    stateTypeId = input.stateTypeId;

                var res = db.stateTypes.FirstOrDefault(e => e.stateTypeId == stateTypeId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:StateTypeManagerBase.cs

示例3: update

        public MemberRoleLookupVo update(MemberRoleLookupVo input, Guid? memberRoleLookupId= null)
        {
            using (var db = new MainDb())
            {

                if (memberRoleLookupId == null)
                    memberRoleLookupId = input.memberRoleLookupId;

                var res = db.memberRoleLookups.FirstOrDefault(e => e.memberRoleLookupId == memberRoleLookupId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:MemberRoleLookupManagerBase.cs

示例4: update

        public BusinessCategoryLookupVo update(BusinessCategoryLookupVo input, Guid? businessCategoryLookupId= null)
        {
            using (var db = new MainDb())
            {

                if (businessCategoryLookupId == null)
                    businessCategoryLookupId = input.businessCategoryLookupId;

                var res = db.businessCategoryLookups.FirstOrDefault(e => e.businessCategoryLookupId == businessCategoryLookupId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:BusinessCategoryLookupManagerBase.cs

示例5: update

        public ImageVo update(ImageVo input, Guid? imageId= null)
        {
            using (var db = new MainDb())
            {

                if (imageId == null)
                    imageId = input.imageId;

                var res = db.images.FirstOrDefault(e => e.imageId == imageId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:ImageManagerBase.cs

示例6: update

        public PropertyListingTypeVo update(PropertyListingTypeVo input, int? propertyListingTypeId= null)
        {
            using (var db = new MainDb())
            {

                if (propertyListingTypeId == null)
                    propertyListingTypeId = input.propertyListingTypeId;

                var res = db.propertyListingTypes.FirstOrDefault(e => e.propertyListingTypeId == propertyListingTypeId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:PropertyListingTypeManagerBase.cs

示例7: update

        public JobCategoryTypeVo update(JobCategoryTypeVo input, int? jobCategoryTypeId= null)
        {
            using (var db = new MainDb())
            {

                if (jobCategoryTypeId == null)
                    jobCategoryTypeId = input.jobCategoryTypeId;

                var res = db.jobCategoryTypes.FirstOrDefault(e => e.jobCategoryTypeId == jobCategoryTypeId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:JobCategoryTypeManagerBase.cs

示例8: update

        public CarVo update(CarVo input, Guid? carId= null)
        {
            using (var db = new MainDb())
            {

                if (carId == null)
                    carId = input.carId;

                var res = db.cars.FirstOrDefault(e => e.carId == carId);

                if (res == null) return null;

                input.created = res.created;
               // input.createdBy = res.createdBy;
                db.Entry(res).CurrentValues.SetValues(input);

                db.SaveChanges();
                return res;

            }
        }
开发者ID:EdvinZohrabyan,项目名称:SilList,代码行数:21,代码来源:CarManagerBase.cs


注:本文中的SO.SilList.Manager.DbContexts.MainDb.Entry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。