Created
March 4, 2020 14:23
-
-
Save btshft/f19641ff8c6f45800784bd620d104379 to your computer and use it in GitHub Desktop.
SomeGist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IBuilder<T> where T : PurchaseDocuments | |
{ | |
Entity Build(T dto); | |
} | |
public abstract class BuilderBase<T> : IBuilder<T> where T : PurchaseDocuments | |
{ | |
public Entity Build(T dto) | |
{ | |
var entity = new Entity(); | |
var purchaser = GetPurchaser(dto); | |
return entity; | |
} | |
protected abstract PurchaserInfo GetPurchaser(T dto); | |
} | |
public class ConcreteBuilder : BuilderBase<EokCancellation> | |
{ | |
/// <inheritdoc /> | |
protected override PurchaserInfo GetPurchaser(EokCancellation dto) | |
{ | |
return dto.Purchaser; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment