Skip to content

Instantly share code, notes, and snippets.

@Lutando
Created March 20, 2017 19:41
Show Gist options
  • Save Lutando/42eb11071f974c2d65b2071c52e4bae9 to your computer and use it in GitHub Desktop.
Save Lutando/42eb11071f974c2d65b2071c52e4bae9 to your computer and use it in GitHub Desktop.
public class PostAuthorizationModel : PostAuthorizationModel<Guid>
{
public Guid OwnerId {get; private set;}
public Guid ResourceId {get; private set;}
private PostAuthorizationModel(Guid ownerId, Guid postId)
{
OwnerId = ownerId;
ResourceId = postId;
}
public static PostAuthorizationModel From(Post resource)
{
return new PostAuthorizationModel(resource.UserId, resource.Id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment