Closed surgicalcoder closed 4 years ago
Sorry for the late response, I've been offline for a while. Can you provide the definition of UserLoginInfo
and Entity
as well?
Sure, UserLoginInfo is from Microsoft.AspNetCore.Identity:
public class UserLoginInfo
{
public UserLoginInfo(string loginProvider, string providerKey, string displayName)
{
LoginProvider = loginProvider;
ProviderKey = providerKey;
ProviderDisplayName = displayName;
}
public string LoginProvider { get; set; }
public string ProviderKey { get; set; }
public string ProviderDisplayName { get; set; }
}
and Entity is:
public abstract class Entity : IEquatable<Entity>
{
public virtual string Id { get; set; }
public virtual long? Version { get; set; }
public bool Equals(Entity other)
{
return other != null && this.Id == other.Id;
}
}
Unfortunately, I wasn't able to reproduce this issue. After running MappingGenerator action on your code I'm getting the following output:
public static UserLoginInfoEntity Convert(this UserLoginInfo info)
{
return new UserLoginInfoEntity(loginProvider: info.LoginProvider, providerKey: info.ProviderKey, providerDisplayName: info.ProviderDisplayName);
}
What version of VisualStudio and MappingGenerator are you using? Can you provide a sample project which reproduces this issue?
Exception:
Method:
Source object is Microsoft.AspNetCore.Identity.UserLoginInfo
Destination object is:
If I comment out the constructors, it generates without an issue.