From() публичный статический Метод

public static From ( object o ) : Person
o object
Результат Person
Пример #1
0
        public async Task AsEnumerableAsyncWithSelector_WhenCalledAndAwaited_ReturnsResultSet()
        {
            var command        = PrepareCommand();
            var commandBuilder = new CommandBuilder(command, DbConfig.Default);

            command.SetResultSet(Person.GetSingleResultSet());

            var result = (await commandBuilder.AsEnumerableAsync(d => (Person)Person.From(d))).ToList();

            Person.VerifySingleResultSet(result);
        }
Пример #2
0
        public void AsEnumerableWithSelector_WhenCalled_ReturnsResults()
        {
            var command = PrepareCommand();

            var commandBuilder = new CommandBuilder(command, DbConfig.Default);

            command.SetResultSet(Person.GetSingleResultSet());

            var result = commandBuilder.AsEnumerable(d => (Person)Person.From(d)).ToList();

            Person.VerifySingleResultSet(result);
        }
Пример #3
0
        public async Task AsEnumerableAsyncWithSelector_WhenCalledAndAwaited_ReturnsResultSet()
        {
            var command        = PrepareCommand();
            var commandBuilder = new CommandBuilder(command, DbConfig.Default);

            command.SetResultSet(Person.GetSingleResultSet());

            var result = new List <Person>();

            await foreach (var p in commandBuilder.AsEnumerableAsync(d => (Person)Person.From(d)))
            {
                result.Add(p);
            }

            Person.VerifySingleResultSet(result);
        }