public static EntityORM Map(VerificationDb verify, HashSet <string> attributes) { EntityORM entity = new EntityORM(); foreach (string attribute in attributes) { object value = null; switch (attribute) { case "EMAIL": value = $"\'{verify.Email}\'"; break; case "TOKEN": value = $"\'{verify.Token}\'"; break; case "ENDVERIFYDATE": value = $"TO_TIMESTAMP(\'{verify.EndVerifyDate.ToString("dd.MM.yyyy HH:mm:ss")}\', 'DD.MM.YYYY HH24:MI:SS')"; break; } entity.attributeValue.Add(attribute, value); } return(entity); }
public VerificationDb Map(Verification verify) { VerificationDb verify_newType = new VerificationDb(); verify_newType.Email = verify.Email; verify_newType.EndVerifyDate = verify.EndVerifyDate; verify_newType.Token = verify.Token; return(verify_newType); }
public static void Map(EntityORM entity, out VerificationDb verify) { verify = new VerificationDb(); foreach (KeyValuePair <string, object> aV in entity.attributeValue) { switch (aV.Key) // entity attribute { case "EMAIL": verify.Email = aV.Value.ToString(); break; case "TOKEN": verify.Token = aV.Value.ToString(); break; case "ENDVERIFYDATE": verify.EndVerifyDate = (DateTime)(aV.Value); break; } } }
public long Create(Verification verify) { VerificationDb verifydb = mapper.Map(verify); return(verifyDAO.Save(verifydb)); }