Passing a unique identifier as a parameter

Hey, I just wanted to find out if I have a parameter with type uniqueidentifier, how can I pass this in my code as a parameter:

personId uniqueidentifier

public IQueryable<Report_person>GetPerson(uniqueidentifier personId)

Thank.

+3
source share
2 answers

Depending on your unique identifier. C # has a class Guidthat is used for globally unique identifiers, or if it is for a database, and you only have an incremental identification number, like an identifier, and intwill be ok. Depending on how you create the identifier and what you use it for, but usually a unique identifier is presented in C # Guidor a globally unique identifier

Guid uniqueId = Guid.NewGuid();

public IQueryable<Report_person>GetPerson(Guid personId) {}
+5
source

Usually uniqueidentifiermatched System.Guidas specified in SqlDbType .

+9
source

All Articles