public override bool Convert(Contract contract) { try { var converter = new ContractConverter(contract); converter.ConvertContract(); ConvertedCode = converter.GetSolidityCode(); ErrorMessage = null; return(true); } catch (Exception e) { ConvertedCode = null; ErrorMessage = e.Message; return(false); } }
public static string PropertyTypeToString(Property property, ContractConverter contractConverter) { var type = property.DataType; //Get the datatype name if reference string typeAsString; if (type == PropertyDataType.Reference) { typeAsString = contractConverter.GetDataType(property.ReferencedDataType).ToStructureName(); } else { typeAsString = PrimitivePropertyTypeToString(type); } if (property.PropertyType == PropertyType.Collection) { typeAsString += "[]"; } return(typeAsString); }
public ContractService(IUnitOfWork uow) { _uow = uow; _converter = new ContractConverter(); }
public ContractConverterShould() { _converter = new ContractConverter(); }