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


C# Guid.IsEmpty方法代码示例

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


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

示例1: ModifyColumn

        public CustomBoardColumn ModifyColumn(Guid projectId, Guid columnId, string name, string description, int limit)
        {
            var project = _projectService.GetProjectFromId(projectId);

            if(columnId.IsEmpty())
            {
                var newColumn = new CustomBoardColumn {Name = name, Description = description, CardLimit = limit};
                project.AddBoardColumn(newColumn);
                _customBoardColumnRepository.Save(newColumn);
                _projectService.SaveProject(project);
                return newColumn;
            }
            else
            {
                var column = project.GetBoardColumns().Where(x => x.Id == columnId).FirstOrDefault();

                if(column != null)
                {
                    column.Name = name;
                    column.Description = description;
                    column.CardLimit = limit;

                    _customBoardColumnRepository.Save(column);
                    return column;
                }

            }

            return null;
        }
开发者ID:rauhryan,项目名称:kokugen,代码行数:30,代码来源:IBoardService.cs

示例2: GetById

        /// <summary>
        /// Gets a task
        /// </summary>
        /// <param name="taskId">Task identifier</param>
        /// <returns>Task</returns>
        public virtual ScheduleTask GetById(Guid taskId)
        {
            if (taskId.IsEmpty())
                return null;

            return taskRepository.GetById(taskId);
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:12,代码来源:ScheduleTaskService.cs

示例3: GetById

        /// <summary>
        /// Gets an email account by identifier
        /// </summary>
        /// <param name="emailAccountId">The email account identifier</param>
        /// <returns>Email account</returns>
        public virtual EmailAccount GetById(Guid emailAccountId)
        {
            if (emailAccountId.IsEmpty())
                return null;

            var emailAccount = emailAccountRepository.GetById(emailAccountId);
            return emailAccount;
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:13,代码来源:EmailAccountService.cs

示例4: GetById

        /// <summary>
        /// Gets a message template
        /// </summary>
        /// <param name="messageTemplateId">Message template identifier</param>
        /// <returns>Message template</returns>
        public virtual MessageTemplate GetById(Guid messageTemplateId)
        {
            if (messageTemplateId.IsEmpty())
                return null;

            string key = string.Format(MESSAGETEMPLATES_BY_ID_KEY, messageTemplateId);
            return cacheManager.Get(key, () =>
            {
                var manufacturer = messageTemplateRepository.GetById(messageTemplateId);
                return manufacturer;
            });
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:17,代码来源:MessageTemplateService.cs

示例5: GetById

        /// <summary>
        /// Gets a company
        /// </summary>
        /// <param name="companyId">company identifier</param>
        /// <returns>A company</returns>
        public virtual Company GetById(Guid companyId)
        {
            if (companyId.IsEmpty())
                return null;

            string key = string.Format(COMPANY_BY_ID_KEY, companyId);
            return this.cacheManager.Get(key, () =>
            {
                var company = this.companyRepository.GetById(companyId);
                return company;
            });
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:17,代码来源:CompanyService.cs

示例6: CreateOrUpdatePort

        //create or update
        public ActionResult CreateOrUpdatePort(Guid rowId, Guid countryId)
        {
            var model = new PortModel();

            if (rowId.IsEmpty())
                model.CountryId = countryId;
            else
            {
                var port = portService.GetById(rowId);
                if (port != null)
                {
                    model = port.ToModel();
                    model.IsEdit = true;
                }
            }

            return PartialView("_CreateOrUpdatePort", model);
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:19,代码来源:CountryController.cs

示例7: Create

        public ActionResult Create(Guid rowId)
        {
            var model = new SettingModel()
            {
                RowId = rowId
            };

            if (!rowId.IsEmpty())
            {
                var setting = settingService.GetById(rowId);
                if (setting != null)
                {
                    model.Name = setting.Name;
                    model.Value = setting.Value;
                    model.IsEdit = true;
                }
            }

            return PartialView("_CreateUpdate", model);
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:20,代码来源:SettingController.cs

示例8: GetFileById

        /// <summary>
        /// Gets a file
        /// </summary>
        /// <param name="fileId">FileMetaData identifier</param>
        /// <returns>FileMetaData</returns>
        public virtual FileMetaData GetFileById(Guid fileId)
        {
            if (fileId.IsEmpty())
                return null;

            var fileData = fileRepository.GetById(fileId);
            return fileData;
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:13,代码来源:FileDataService.cs

示例9: GetById

        /// <summary>
        /// Gets a port
        /// </summary>
        /// <param name="portId">The port identifier</param>
        /// <returns>port</returns>
        public virtual Port GetById(Guid portId)
        {
            if (portId.IsEmpty())
                return null;

            string key = string.Format(PORTS_BY_ID_KEY, portId);
            return this.cacheManager.Get(key, () =>
            {
                var port = this.dataRepository.GetById(portId);
                return port;
            });
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:17,代码来源:PortService.cs

示例10: Update

        public void Update(Guid characterId, ICharacterData characterData)
        {
            if (characterId.IsEmpty()) throw new ArgumentException("characterId");
            if (characterData == null) throw new ArgumentNullException("characterData");

            throw new NotImplementedException();
        }
开发者ID:kalantyr,项目名称:Parallel,代码行数:7,代码来源:FileDatabase.cs

示例11: GetActivityTypeById

        /// <summary>
        /// Gets an activity log type item
        /// </summary>
        /// <param name="activityLogTypeId">Activity log type identifier</param>
        /// <returns>Activity log type item</returns>
        public virtual ActivityLogType GetActivityTypeById(Guid activityLogTypeId)
        {
            if (activityLogTypeId.IsEmpty())
                return null;

            string key = string.Format(ACTIVITYTYPE_BY_ID_KEY, activityLogTypeId);
            return cacheManager.Get(key, () =>
            {
                return activityLogTypeRepository.GetById(activityLogTypeId);
            });
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:16,代码来源:UserActivityService.cs

示例12: Edit

        public ActionResult Edit(Guid rowId)
        {
            if (rowId.IsEmpty())
                return RedirectToAction(SystemRouteNames.Index);

            var client = clientService.GetById(rowId);

            if (client == null)
                return RedirectToAction(SystemRouteNames.Index);

            var model = client.ToModel();
            PrepareAddEditModel(model);

            var associatedOffices = client.GetAttribute<List<Guid>>(SystemAttributeNames.AssociatedBrancOffices);
            if (associatedOffices != null && associatedOffices.Count > 0)
                model.OfficeId = associatedOffices.ToDelimitedString();

            model.IsEdit = true;

            return View(model);
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:21,代码来源:ClientController.cs

示例13: RemoveUsersFromRoles

        public void RemoveUsersFromRoles(Guid[] userIds, string[] roleNames)
        {
            if (userIds.IsEmpty() || roleNames == null)
            {
                throw new ArgumentException("Please specify one or more user ids and/or one or more role names.");
            }

            List<Guid> roleIds = new List<Guid>();

            foreach (var name in roleNames)
            {
                roleIds.Add(this.GetRoleId(name, "user", "remove"));
            }

            var entries = this._dataSource.Query<UserInRole>().Where(e => userIds.Contains(e.UserId) && roleIds.Contains(e.GroupRole.RoleId));
            var groupIds = entries.Select(e => e.GroupRoleGroupId).Distinct().ToArray();
            var groupEntries = this._dataSource.Query<GroupInRole>().Where(e => groupIds.Contains(e.GroupId)).ToList();

            foreach (var entry in entries)
            {
                var groupEntry = groupEntries.First(g => g.GroupId == entry.GroupRoleGroupId);
                groupEntry.CurrentNumberOfUsers--;
            }

            this._dataSource.Delete(entries);
            _userRoles.Clear();
        }
开发者ID:StrixIT,项目名称:StrixIT.Platform.Modules.Membership,代码行数:27,代码来源:RoleManager.cs

示例14: GetById

        /// <summary>
        /// Gets a user
        /// </summary>
        /// <param name="userId">user identifier</param>
        /// <returns>A user</returns>
        public virtual Client GetById(Guid clientId)
        {
            if (clientId.IsEmpty())
                return null;

            string key = string.Format(CLIENTS_BY_ID_KEY, clientId);
            return this.cacheManager.Get(key, () =>
            {
                var client = this.clientRepository.GetById(clientId);
                return client;
            });
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:17,代码来源:ClientService.cs

示例15: GetById

        /// <summary>
        /// Gets a state/province
        /// </summary>
        /// <param name="stateProvinceId">The state/province identifier</param>
        /// <returns>State/province</returns>
        public virtual StateProvince GetById(Guid stateProvinceId)
        {
            if (stateProvinceId.IsEmpty())
                return null;

            string key = string.Format(STATEPROVINCES_BY_ID_KEY, stateProvinceId);
            return this.cacheManager.Get(key, () =>
            {
                var category = this.stateProvinceRepository.GetById(stateProvinceId);
                return category;
            });
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:17,代码来源:StateProvinceService.cs


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