Пример #1
0
 public override int StoreParties(IEnumerable <Party> parties)
 {
     using (var connection = _sqlTableWithPrimaryKey.NewConnection(connectionString))
     {
         return(_sqlTableWithPrimaryKey.InsertOrReplace(connection, partySql, parties));
     }
 }
Пример #2
0
        public A4AMessage AddMessage(A4AMessageSetter setter)
        {
            int foo = messageSql.InsertOrReplace(conn, new [] { new A4AMessage {
                                                                    TextContent = setter.Message, MessageId = setter.Id
                                                                } });

            var z = messageSql.SelectData <A4AMessage>(conn, $" MessageId like '{setter.Id}'", new Range(), new Sort()).Select(x => x.GetObject()).FirstOrDefault();

            if (z == null)
            {
                throw new Exception($"Could not find recently added object with id - {setter.Id}");
            }

            return(z);
        }