I'm trying to seed my database with Bogus and Faker when this error occurs:
error CS1593: Delegate 'Func<Faker, Address, short>' does not take 1 arguments
This is my code snippet and the error starts at the BuildingNumber method.
if (!context.Addresses.Any())
{
var faker = new Bogus.DataSets.Address();
var addressSkeleton = new Faker<Resa.Models.Address>()
.RuleFor(a => a.Street, f => faker.StreetAddress())
.RuleFor(a => a.Number, f => faker.BuildingNumber())
.RuleFor(a => a.Latitude, f => faker.Latitude())
.RuleFor(a => a.Longitude, f => faker.Longitude())
.FinishWith((f,a) => {
Console.WriteLine("Address created with Bogus: {0}!", a.Street);
});
According to the documentation found at https://github.com/bchavez/Bogus there should be no parameter in the method.
I think the source of the problem might be that your "Number" property is type of short and the "BuildingNumber" method returns string instead of short. I am not sure for this answer, just looked your code and Bogus then write down this answer. I hope it helps.