Пример #1
0
 public LogMaintainer(
     logs log,
     ILogRepository repository,
     ITimeService timeService,
     INpgsqlConnectionFactory connectionFactory)
 {
     _repository = repository;
     _timeService = timeService;
     _connectionFactory = connectionFactory;
     _timeToStore = log.time_to_store.HasValue ? new TimeSpan(log.time_to_store.Value) as TimeSpan? : null;
 }
Пример #2
0
 public ILogMaintainer Create(string connectionString, logs log, ITimeService timeService)
 {
     var npgsqlConnectionFactory = new NpgsqlConnectionFactory(connectionString);
     var logRepository = new LogRepository(log.id);
     using (var connection = npgsqlConnectionFactory.Create())
     {
         logRepository.EnsureTable(connection);
     }
     return new LogMaintainer(
         log,
         logRepository,
         timeService,
         npgsqlConnectionFactory);
 }
Пример #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the logs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTologs(logs logs)
 {
     base.AddObject("logs", logs);
 }
Пример #4
0
 /// <summary>
 /// Create a new logs object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 public static logs Createlogs(global::System.Int32 id, global::System.String name)
 {
     logs logs = new logs();
     logs.id = id;
     logs.name = name;
     return logs;
 }