Commit f2a1b9b0 authored by Anthony Mochel's avatar Anthony Mochel
Browse files

fix(eneity): change entity settings

parent dcfa5cb7
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6">
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
......@@ -73,11 +65,25 @@
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.19.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<connectionStrings><add name="delmeEntities" connectionString="metadata=res://*/BeeWeatherModel.csdl|res://*/BeeWeatherModel.ssdl|res://*/BeeWeatherModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=digitalbeekeeper.de;user id=cnam1;password=Belana2016();persistsecurityinfo=True;database=delme&quot;" providerName="System.Data.EntityClient" /><add name="delmeEntities1" connectionString="metadata=res://*/BeesWeatherModel.csdl|res://*/BeesWeatherModel.ssdl|res://*/BeesWeatherModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=digitalbeekeeper.de;user id=cnam1;password=Belana2016();persistsecurityinfo=True;database=delme&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
<!-- Connection string -->
<connectionStrings>
<add name="delmeEntities" connectionString="metadata=res://*/BeeWeatherModel.csdl|res://*/BeeWeatherModel.ssdl|res://*/BeeWeatherModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=digitalbeekeeper.de;user id=cnam1;password=Belana2016();persistsecurityinfo=True;database=delme&quot;" providerName="System.Data.EntityClient" />
<add name="delmeEntities1" connectionString="metadata=res://*/BeesWeatherModel.csdl|res://*/BeesWeatherModel.ssdl|res://*/BeesWeatherModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=digitalbeekeeper.de;user id=cnam1;password=Belana2016();persistsecurityinfo=True;database=delme&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
<!-- Application Settings -->
<appSettings>
<!-- ... -->
<add key="CityId" value="2925533" />
<add key="PartregionId" value="91" />
<!-- ... -->
</appSettings>
</configuration>
<!-- Entity Framwork -->
<entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6">
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</providers>
</entityFramework>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\EntityFramework.6.4.0\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.0\build\EntityFramework.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -40,10 +39,13 @@
<HintPath>..\packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.dll</HintPath>
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.Entity.6.10.9\lib\net452\MySql.Data.Entity.EF6.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\WeatherNet.2.1\lib\Newtonsoft.Json.dll</HintPath>
......@@ -158,7 +160,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="LoggerManager.cs" />
<Compile Include="beehive_poll_forecast.cs">
<DependentUpon>BeesWeatherModel.tt</DependentUpon>
</Compile>
......@@ -217,12 +218,4 @@
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\EntityFramework.6.4.0\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.0\build\EntityFramework.props'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.0\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.0\build\EntityFramework.targets'))" />
</Target>
<Import Project="..\packages\EntityFramework.6.4.0\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.0\build\EntityFramework.targets')" />
</Project>
</Project>
\ No newline at end of file
......@@ -9,10 +9,11 @@
namespace BeeWeatherPollenTracker
{
using System;
using MySql.Data.Entity;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
[DbConfigurationType(typeof(MySqlEFConfiguration))]
public partial class delmeEntities1 : DbContext
{
public delmeEntities1()
......
using MySql.Data.EntityFramework;
using MySql.Data.Entity;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
......@@ -11,20 +11,30 @@ using WeatherNet.Clients;
namespace BeeWeatherPollenTracker
{
[DbConfigurationType(typeof(MySqlEFConfiguration))]
internal static class Program
{
#region Constantes
private const string OPEN_WEATHER_MAP_API_KEY = "3f80e65ed0609e7e52737e65d522aed8";
private const double FORECAST_LENGTH = 3.0;
private const string POLLEN_FORECAST_URL =
"https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json";
private const string POLLEN_FORECAST_URL = "https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json";
#endregion
private static LoggerManager logs = null;
static LoggerManager logs = null;
private static void Main(string[] args)
{
/*
* Settings
*/
// Set Entity Configuration
DbConfiguration.SetConfiguration(new MySqlEFConfiguration());
// Set up API KEY
ClientSettings.SetApiKey(OPEN_WEATHER_MAP_API_KEY);
// Set up the logger manager
logs = LoggerManager.GetInstance();
......@@ -56,11 +66,18 @@ namespace BeeWeatherPollenTracker
var pollenRegionForecast = pollenData.Content
.First(p => p.PartregionId.ToString() == ConfigurationManager.AppSettings["PartregionId"]);
}
catch (Exception e)
{
logs.WriteInFile(e);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.8.3.1" targetFramework="net472" />
<package id="EntityFramework" version="6.4.0" targetFramework="net472" />
<package id="WeatherNet" version="2.1" targetFramework="net472" />
<package id="EntityFramework" version="6.2.0" targetFramework="net472" />
<package id="EntityFramework.fr" version="6.2.0" targetFramework="net472" />
<package id="Google.Protobuf" version="3.6.1" targetFramework="net472" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net472" />
......@@ -22,6 +21,7 @@
<package id="Microsoft.Extensions.Options" version="3.1.2" targetFramework="net472" />
<package id="Microsoft.Extensions.Primitives" version="3.1.2" targetFramework="net472" />
<package id="MySql.Data" version="8.0.19" targetFramework="net472" />
<package id="MySql.Data.Entity" version="6.10.9" targetFramework="net472" />
<package id="MySqlConnector" version="0.62.0" targetFramework="net472" />
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.4.0" targetFramework="net472" />
......@@ -32,4 +32,5 @@
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net472" />
<package id="WeatherNet" version="2.1" targetFramework="net472" />
</packages>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment