public void CanMap() { PersistedGrant model = new PersistedGrant(); Entities.PersistedGrant mappedEntity = model.ToEntity(); PersistedGrant mappedModel = mappedEntity.ToModel(); Assert.NotNull(mappedModel); Assert.NotNull(mappedEntity); }
public PersistedGrant Get(string key) { if (string.IsNullOrWhiteSpace(key)) { return(null); } Entities.PersistedGrant persistedGrant = null; using (var connection = _options.DbProviderFactory.CreateConnection()) { connection.ConnectionString = _options.ConnectionString; persistedGrant = connection.QueryFirstOrDefault <Entities.PersistedGrant>("select * from PersistedGrants where Key = @Key", new { Key = key }, commandTimeout: _options.CommandTimeOut, commandType: CommandType.Text); } return(persistedGrant?.ToModel()); }