Slide 23
Slide 23 text
Sansan Builders Box
v2 : コードの雰囲気(Repository)
Domain
Model
Repository
Service foreach (var custom in CustomUpdate)
{
if (custom is string)
{
var customString = (string)custom;
switch (customString)
{
case "Address.PostalCode":
addressSetClause.AppendFormat("{0}postal_code = :POSTAL_CODE ", comma);
var postalCodeParam = DbParameterFactory.Create(card.Address.PostalCode);
postalCodeParam.ParameterName = ":POSTAL_CODE";
paramList.Add(postalCodeParam);
if (string.IsNullOrEmpty(comma)) comma = ",";
break;
case "Address.Prefecture":
addressSetClause.AppendFormat("{0}address_prefecture = :ADDRESS_PREFECTURE ", comma);
var prefectureParam = DbParameterFactory.Create(card.Address.Prefecture);
prefectureParam.ParameterName = ":ADDRESS_PREFECTURE";
paramList.Add(prefectureParam);
if (string.IsNullOrEmpty(comma)) comma = ",";
break;
case "Address.City":
addressSetClause.AppendFormat("{0}address_city = :ADDRESS_CITY ", comma);
var cityParam = DbParameterFactory.Create(card.Address.City);
cityParam.ParameterName = ":ADDRESS_CITY";
paramList.Add(cityParam);
if (string.IsNullOrEmpty(comma)) comma = ",";
break;
case "Address.Street":
addressSetClause.AppendFormat("{0}address_street = :ADDRESS_STREET ", comma);
var streetParam = DbParameterFactory.Create(card.Address.Street);
streetParam.ParameterName = ":ADDRESS_STREET";
paramList.Add(streetParam);
if (string.IsNullOrEmpty(comma)) comma = ",";
break;
case "Address.Building":
addressSetClause.AppendFormat("{0}address_building = :ADDRESS_BUILDING ", comma);
var buildingParam = DbParameterFactory.Create(card.Address.Building);
buildingParam.ParameterName = ":ADDRESS_BUILDING";