Пример #1
0
        public Task Merge(DealerManifest.Asset asset) =>
        _dealerOnDb.ExecuteAction(connection =>
        {
            var sql = $@"
update
	VehiclePhotos
set
	caption = @Caption
where
	path = @Path

if @@rowcount = 0
begin
  insert into VehiclePhotos
  (
	  year,
    make,
    model,
    number,
    path,
    caption,
    responsive,
	  is_campaign
  )
  values
  (
	  null,
	  'toyota',
	  null,
	  1,
	  @Path,
	  @Caption,
	  0,
	  1
  )
end
";

            return(connection.ExecuteAsync(sql, new
            {
                Path = _bannerPath.GetPath(asset.File.Name),
                asset.Caption
            }));
        });
Пример #2
0
 void Given(DealerManifestDownloaded e) =>
 _asset = e.Assets.First(asset => asset.Id == Id);