C# Class GoogleCloudSamples.Models.DatastoreBookStoreExtensionMethods

显示文件 Open project: GoogleCloudPlatform/getting-started-dotnet

Public Methods

Method Description
ToBook ( this entity ) : Book

Unpack a book from a datastore entity.

ToEntity ( this book ) : System.Entity

Create a datastore entity with the same values as book.

ToId ( this key ) : long

Make a book id given a datastore key.

ToKey ( this id ) : Key

Make a datastore key given a book's id.

Method Details

ToBook() public static method

Unpack a book from a datastore entity.
public static ToBook ( this entity ) : Book
entity this An entity retrieved from datastore.
return Book

ToEntity() public static method

Create a datastore entity with the same values as book.
public static ToEntity ( this book ) : System.Entity
book this The book to store in datastore.
return System.Entity

ToId() public static method

Make a book id given a datastore key.
public static ToId ( this key ) : long
key this A datastore key
return long

ToKey() public static method

Make a datastore key given a book's id.
public static ToKey ( this id ) : Key
id this A book's id.
return Key