public static int Create(EntityDecision decision, string title, int order = 0)
 => ExecuteScalarInt(
     @"INSERT INTO entity_decision_options(guid, decision_id, title, ""order"")
                         VALUES (@guid, @decision_id, @title, @order);
                         SELECT currval('entity_decision_options_id_seq');"
     , new { guid = Guid.NewGuid().ToString(), decision_id = decision.id, title, order }
     );
        public static List <EntityDecisionOption> CreateMany(ushort amount, DecisionModel decision = null)
        {
            var result = new List <EntityDecisionOption>();

            for (ushort i = 0; i < amount; i++)
            {
                result.Add(Create(decision));
            }

            return(result);
        }
 public static EntityDecisionOption[] Find(EntityDecision decision)
 => Connection().Query <EntityDecisionOption>(
     "SELECT * FROM entity_decision_options WHERE decision_id = @decision_id LIMIT 10",
     new { decision_id = decision.id }
     ).ToArray();
 public static EntityDecisionOption Create(DecisionModel decision = null)
 {
     decision ??= EntityDecisionFaker.Create();
     return(EntityDecisionOptionRepository.Create(decision, "option " + Rand.RandomString()));
 }