本文整理汇总了C#中System.Guid类的典型用法代码示例。如果您正苦于以下问题:C# Guid类的具体用法?C# Guid怎么用?C# Guid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Guid类属于System命名空间,在下文中一共展示了Guid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReplicationCursor
internal ReplicationCursor(DirectoryServer server, string partition, Guid guid, long filter)
{
this.partition = partition;
this.invocationID = guid;
this.USN = filter;
this.server = server;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:ReplicationCursor.cs
示例2: IsProfileAllreadyExist
public bool IsProfileAllreadyExist(Guid UserId, string WPUserId)
{
using (NHibernate.ISession session = SessionFactory.GetNewSession())
{
//After Session creation, start Transaction.
using (NHibernate.ITransaction transaction = session.BeginTransaction())
{
try
{
//Proceed action, to Check if FacebookUser is Exist in database or not by UserId and FbuserId.
// And Set the reuired paremeters to find the specific values.
List<Domain.Socioboard.Domain.WordpressAccount> alst = session.CreateQuery("from WordpressAccount where UserId = :userid and WpUserId = :WpUserId")
.SetParameter("userid", UserId)
.SetParameter("WpUserId", WPUserId)
.List<Domain.Socioboard.Domain.WordpressAccount>()
.ToList<Domain.Socioboard.Domain.WordpressAccount>();
if (alst.Count == 0 || alst == null)
return false;
else
return true;
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
return true;
}
}//End Transaction
}//End session
}
开发者ID:prog-moh,项目名称:socioboard-core,代码行数:30,代码来源:WordpressAccountRepository.cs
示例3: GetWordpressAccountById
public Domain.Socioboard.Domain.WordpressAccount GetWordpressAccountById(Guid id, string wpid)
{
using (NHibernate.ISession session = SessionFactory.GetNewSession())
{
//After Session creation, start Transaction.
using (NHibernate.ITransaction transaction = session.BeginTransaction())
{
try
{
//Proceed action, to Check if FacebookUser is Exist in database or not by UserId and FbuserId.
// And Set the reuired paremeters to find the specific values.
NHibernate.IQuery query = session.CreateQuery("from WordpressAccount where UserId = :userid and WpUserId = :WpUserId");
query.SetParameter("userid", id);
query.SetParameter("WpUserId", wpid);
return (Domain.Socioboard.Domain.WordpressAccount)query.UniqueResult();
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
return null;
}
}//End Transaction
}//End session
}
开发者ID:prog-moh,项目名称:socioboard-core,代码行数:25,代码来源:WordpressAccountRepository.cs
示例4: TaskEventArgs
public TaskEventArgs(Guid instanceId, string id, string assignee, string text)
:base(instanceId)
{
this.idValue = id;
this.assigneeValue = assignee;
this.textValue = text;
}
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:7,代码来源:TaskService.cs
示例5: GetDraft
/// <summary>
/// Gets the draft data for the media entity with the given id.
/// </summary>
/// <param name="id">The id</param>
/// <param name="type">The media type</param>
/// <returns>The draft media data, null if the data wasn't found</returns>
public virtual byte[] GetDraft(Guid id, MediaType type = MediaType.Media) {
var path = GetPath(id, true, type);
if (File.Exists(path))
return File.ReadAllBytes(path);
return null;
}
开发者ID:jerry-he,项目名称:Piranha,代码行数:13,代码来源:LocalMediaProvider.cs
示例6: CreateOpf
/// <summary>
/// Generates the manifest and metadata information file used by the .epub reader
/// (content.opf). For more information, refer to <see cref="http://www.idpf.org/doc_library/epub/OPF_2.0.1_draft.htm#Section2.0"/>
/// </summary>
/// <param name="projInfo">Project information</param>
/// <param name="contentFolder">Content folder (.../OEBPS)</param>
/// <param name="bookId">Unique identifier for the book we're generating.</param>
public void CreateOpf(PublicationInformation projInfo, string contentFolder, Guid bookId)
{
XmlWriter opf = XmlWriter.Create(Common.PathCombine(contentFolder, "content.opf"));
opf.WriteStartDocument();
// package name
opf.WriteStartElement("package", "http://www.idpf.org/2007/opf");
opf.WriteAttributeString("version", "2.0");
opf.WriteAttributeString("unique-identifier", "BookId");
// metadata - items defined by the Dublin Core Metadata Initiative:
Metadata(projInfo, bookId, opf);
StartManifest(opf);
if (_parent.EmbedFonts)
{
ManifestFontEmbed(opf);
}
string[] files = Directory.GetFiles(contentFolder);
ManifestContent(opf, files, "epub2");
Spine(opf, files);
Guide(projInfo, opf, files, "epub2");
opf.WriteEndElement(); // package
opf.WriteEndDocument();
opf.Close();
}
开发者ID:neilmayhew,项目名称:pathway,代码行数:32,代码来源:EpubManifest.cs
示例7: CloseById
public void CloseById(Guid id)
{
var delAllocation = _unitOfWork.OtherDispatchAllocationRepository.Get().FirstOrDefault(allocation => allocation.OtherDispatchAllocationID == id);
if (delAllocation != null) delAllocation.IsClosed = true;
_unitOfWork.OtherDispatchAllocationRepository.Add(delAllocation);
_unitOfWork.Save();
}
开发者ID:edgecomputing,项目名称:cats-hub-module,代码行数:7,代码来源:OtherDispatchAllocationService.cs
示例8: Click
/// <summary>
/// Initializes a new instance of the Task data contract class given its required properties.
/// </summary>
/// <param name="clickGuid">Click Guid</param>
/// <param name="facilityGuid">Facility Guid</param>
/// <param name="listingTypeGuid">Listing Type Guid</param>
/// <param name="timeStamp">Time Stamp</param>
public Click(Guid clickGuid, Guid facilityGuid, Guid listingTypeGuid, DateTime timeStamp)
{
_clickGuid = clickGuid;
_facilityGuid = facilityGuid;
_listingTypeGuid = listingTypeGuid;
_timeStamp = timeStamp;
}
开发者ID:ankit-defacto,项目名称:PSS,代码行数:14,代码来源:Click.cs
示例9: Article
public ActionResult Article(Guid id)
{
foreach (News item in newsManagement.news)
if (item.Id == id)
return View(item);
return Redirect("/error");
}
开发者ID:akhroponiuk,项目名称:NewFolder,代码行数:7,代码来源:NewsController.cs
示例10: EnsureDocumentEtagMatchInTransaction
private void EnsureDocumentEtagMatchInTransaction(string key, Guid? etag)
{
Api.JetSetCurrentIndex(session, DocumentsModifiedByTransactions, "by_key");
Api.MakeKey(session, DocumentsModifiedByTransactions, key, Encoding.Unicode, MakeKeyGrbit.NewKey);
Guid existingEtag;
if (Api.TrySeek(session, DocumentsModifiedByTransactions, SeekGrbit.SeekEQ))
{
if (Api.RetrieveColumnAsBoolean(session, DocumentsModifiedByTransactions, tableColumnsCache.DocumentsModifiedByTransactionsColumns["delete_document"]) == true)
return; // we ignore etags on deleted documents
existingEtag = Api.RetrieveColumn(session, DocumentsModifiedByTransactions, tableColumnsCache.DocumentsModifiedByTransactionsColumns["etag"]).TransfromToGuidWithProperSorting();
}
else
{
existingEtag = Api.RetrieveColumn(session, Documents, tableColumnsCache.DocumentsColumns["etag"]).TransfromToGuidWithProperSorting();
}
if (existingEtag != etag && etag != null)
{
throw new ConcurrencyException("PUT attempted on document '" + key +
"' using a non current etag")
{
ActualETag = etag.Value,
ExpectedETag = existingEtag
};
}
}
开发者ID:jaircazarin,项目名称:ravendb,代码行数:25,代码来源:Util.cs
示例11: Add
public static int Add(
Guid pollGuid,
Guid siteGuid,
String question,
bool anonymousVoting,
bool allowViewingResultsBeforeVoting,
bool showOrderNumbers,
bool showResultsWhenDeactivated,
bool active,
DateTime activeFrom,
DateTime activeTo)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Polls_Insert", 10);
sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
sph.DefineSqlParameter("@Question", SqlDbType.NVarChar, 255, ParameterDirection.Input, question);
sph.DefineSqlParameter("@AnonymousVoting", SqlDbType.Bit, ParameterDirection.Input, anonymousVoting);
sph.DefineSqlParameter("@AllowViewingResultsBeforeVoting", SqlDbType.Bit, ParameterDirection.Input, allowViewingResultsBeforeVoting);
sph.DefineSqlParameter("@ShowOrderNumbers", SqlDbType.Bit, ParameterDirection.Input, showOrderNumbers);
sph.DefineSqlParameter("@ShowResultsWhenDeactivated", SqlDbType.Bit, ParameterDirection.Input, showResultsWhenDeactivated);
sph.DefineSqlParameter("@Active", SqlDbType.Bit, ParameterDirection.Input, active);
sph.DefineSqlParameter("@ActiveFrom", SqlDbType.DateTime, ParameterDirection.Input, activeFrom);
sph.DefineSqlParameter("@ActiveTo", SqlDbType.DateTime, ParameterDirection.Input, activeTo);
int rowsAffected = sph.ExecuteNonQuery();
return rowsAffected;
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:26,代码来源:DBPoll.cs
示例12: Delete
public static bool Delete(Guid pollGuid)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Polls_Delete", 1);
sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
int rowsAffected = sph.ExecuteNonQuery();
return (rowsAffected > 0);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:DBPoll.cs
示例13: Get
public User Get(Guid id)
{
using (var db = base.NewDB())
{
return db.Users.Get(id);
}
}
开发者ID:yuandong618,项目名称:mvcsolution,代码行数:7,代码来源:UserService.cs
示例14: HasValidSignature
public static bool HasValidSignature(string fileName) {
try {
if (_isValidCache.Contains(fileName)) {
return true;
}
var wtd = new WinTrustData(fileName);
var guidAction = new Guid(WINTRUST_ACTION_GENERIC_VERIFY_V2);
WinVerifyTrustResult result = WinTrust.WinVerifyTrust(INVALID_HANDLE_VALUE, guidAction, wtd);
bool ret = (result == WinVerifyTrustResult.Success);
if (ret) {
_isValidCache.Add(fileName);
}
#if COAPP_ENGINE_CORE
var response = Event<GetResponseInterface>.RaiseFirst();
if( response != null ) {
response.SignatureValidation(fileName, ret, ret ? Verifier.GetPublisherInformation(fileName)["PublisherName"] : null);
}
#endif
return ret;
} catch (Exception) {
return false;
}
}
开发者ID:roomaroo,项目名称:coapp.powershell,代码行数:25,代码来源:Verifier.cs
示例15: ChangeName
public ActionResult ChangeName(Guid id, string name, int version)
{
var command = new RenameInventoryItem(id, name, version);
_bus.Send(command);
return RedirectToAction("Index");
}
开发者ID:MHacker9404,项目名称:m-r,代码行数:7,代码来源:HomeController.cs
示例16: GetById
public async Task<NotificationMovementsSummary> GetById(Guid notificationId)
{
await notificationAuthorization.EnsureAccessAsync(notificationId);
var summaryData = await context.NotificationApplications
.GroupJoin(
context.ShipmentInfos,
notification => notification.Id,
shipment => shipment.NotificationId,
(notification, shipments) => new { Notification = notification, Shipment = shipments.FirstOrDefault() })
.Join(context.NotificationAssessments,
x => x.Notification.Id,
na => na.NotificationApplicationId,
(x, na) => new { x.Notification, x.Shipment, NotificationAssessment = na })
.Select(x => new
{
NotificationId = x.Notification.Id,
x.Notification.NotificationType,
x.Notification.NotificationNumber,
NumberOfShipments = x.Shipment == null ? 0 : x.Shipment.NumberOfShipments,
Quantity = x.Shipment == null ? 0 : x.Shipment.Quantity,
Units = x.Shipment == null ? ShipmentQuantityUnits.Tonnes : x.Shipment.Units,
NotificationStatus = x.NotificationAssessment.Status,
x.Notification.CompetentAuthority
})
.SingleAsync(x => x.NotificationId == notificationId);
var totalMovements = await context.Movements
.Where(m =>
m.NotificationId == notificationId)
.CountAsync();
var currentActiveLoads = await context.Movements
.Where(m =>
m.NotificationId == notificationId
&& (m.Status == MovementStatus.Submitted
|| m.Status == MovementStatus.Received)
&& m.Date < SystemTime.UtcNow)
.CountAsync();
var financialGuaranteeCollection =
await context.FinancialGuarantees.SingleAsync(x => x.NotificationId == notificationId);
var financialGuarantee = financialGuaranteeCollection.GetCurrentApprovedFinancialGuarantee() ??
financialGuaranteeCollection.GetLatestFinancialGuarantee();
return NotificationMovementsSummary.Load(summaryData.NotificationId,
summaryData.NotificationNumber,
summaryData.NotificationType,
summaryData.NumberOfShipments,
totalMovements,
financialGuarantee == null ? 0 : financialGuarantee.ActiveLoadsPermitted.GetValueOrDefault(),
currentActiveLoads,
summaryData.Quantity,
(await quantity.Received(notificationId)).Quantity,
summaryData.Units,
financialGuarantee == null ? FinancialGuaranteeStatus.AwaitingApplication : financialGuarantee.Status,
summaryData.CompetentAuthority,
summaryData.NotificationStatus);
}
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:60,代码来源:NotificationMovementsSummaryRepository.cs
示例17: Create
/// <summary>
/// Inserts a row in the mp_ContentWorkflow table. Returns rows affected count.
/// </summary>
/// <param name="guid"> guid </param>
/// <param name="siteGuid"> siteGuid </param>
/// <param name="moduleGuid"> moduleGuid </param>
/// <param name="createdDateUtc"> createdDateUtc </param>
/// <param name="userGuid"> userGuid </param>
/// <param name="status"> status </param>
/// <param name="contentText"> contentText </param>
/// <param name="customData"> customData </param>
/// <param name="customReferenceNumber"> customReferenceNumber </param>
/// <param name="customReferenceGuid"> customReferenceGuid </param>
/// <returns>int</returns>
public static int Create(
Guid guid,
Guid siteGuid,
Guid moduleGuid,
Guid userGuid,
DateTime createdDateUtc,
string contentText,
string customData,
int customReferenceNumber,
Guid customReferenceGuid,
string status)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContentWorkflow_Insert", 10);
sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
sph.DefineSqlParameter("@CreatedDateUtc", SqlDbType.DateTime, ParameterDirection.Input, createdDateUtc);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, 20, ParameterDirection.Input, status);
sph.DefineSqlParameter("@ContentText", SqlDbType.NVarChar, -1, ParameterDirection.Input, contentText);
sph.DefineSqlParameter("@CustomData", SqlDbType.NVarChar, -1, ParameterDirection.Input, customData);
//object customReferenceNumberVal = customReferenceNumber.HasValue ? (object)customReferenceNumber.Value : DBNull.Value;
sph.DefineSqlParameter("@CustomReferenceNumber", SqlDbType.Int, ParameterDirection.Input, customReferenceNumber);
//object customReferenceGuidVal = customReferenceGuid.HasValue ? (object)customReferenceGuid.Value : DBNull.Value;
sph.DefineSqlParameter("@CustomReferenceGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, customReferenceGuid);
int rowsAffected = sph.ExecuteNonQuery();
return rowsAffected;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:45,代码来源:DBContentWorkflow.cs
示例18: UpdateCommitteeEvent
public UpdateCommitteeEvent(Guid committeeId, Guid departmentId, string name, string mandate)
{
CommitteeId = committeeId;
DepartmentId = departmentId;
Name = name;
Mandate = mandate;
}
开发者ID:dburriss,项目名称:ddd_es,代码行数:7,代码来源:UpdateCommitteeEvent.cs
示例19: GetSuggestion
public HttpResponseMessageWrapper<Suggestion> GetSuggestion(HttpRequestMessage req, Guid id)
{
Operation operation = null;
HttpStatusCode code = AuthenticateUser(req);
if (code != HttpStatusCode.OK)
{ // user not authenticated
return ReturnResult<Suggestion>(req, operation, code);
}
try
{
Suggestion suggestion = this.SuggestionsStorageContext.Suggestions.Single<Suggestion>(s => s.ID == id);
if (!ValidateEntityOwnership(suggestion.EntityID, suggestion.EntityType))
{ // entity associated with suggestions does not belong to the authenticated user, return 403 Forbidden
TraceLog.TraceError("Associated entity does not belong to current user)");
return ReturnResult<Suggestion>(req, operation, HttpStatusCode.Forbidden);
}
var response = ReturnResult<Suggestion>(req, operation, suggestion, HttpStatusCode.OK);
response.Headers.CacheControl = new CacheControlHeaderValue() { NoCache = true };
return response;
}
catch (Exception ex)
{ // suggestion not found - return 404 Not Found
TraceLog.TraceException("Resource not found", ex);
return ReturnResult<Suggestion>(req, operation, HttpStatusCode.NotFound);
}
}
开发者ID:ogazitt,项目名称:product,代码行数:27,代码来源:SuggestionResource.cs
示例20: Select
public Core.Business.OperateSort Select(Guid id)
{
SqlServerUtility sql = new SqlServerUtility();
sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
SqlDataReader reader = sql.ExecuteSPReader("usp_SelectOperateSort");
if (reader != null && !reader.IsClosed && reader.Read())
{
Core.Business.OperateSort operateSort = new Core.Business.OperateSort();
if (!reader.IsDBNull(0)) operateSort.Id = reader.GetGuid(0);
if (!reader.IsDBNull(1)) operateSort.OperateSortName = reader.GetString(1);
reader.Close();
return operateSort;
}
else
{
if (reader != null && !reader.IsClosed)
reader.Close();
return null;
}
}
开发者ID:dalinhuang,项目名称:cy-csts,代码行数:25,代码来源:OperateSortProvider.cs
注:本文中的System.Guid类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论