Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TourDataManager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill
TourDataManager
Commits
6c89ad6c
Commit
6c89ad6c
authored
Oct 11, 2018
by
Kirill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sqliteef6' into develop
parents
0750ea4b
41fe87fc
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
30 deletions
+46
-30
App.config
TourDataManager/App.config
+1
-10
Db.cs
TourDataManager/Db.cs
+3
-2
EF6CodeConfig.cs
TourDataManager/EF6CodeConfig.cs
+0
-17
Estate.cs
TourDataManager/Entities/Estate.cs
+16
-0
Tour.cs
TourDataManager/Entities/Tour.cs
+24
-0
TourDataManager.csproj
TourDataManager/TourDataManager.csproj
+2
-1
No files found.
TourDataManager/App.config
View file @
6c89ad6c
...
@@ -6,13 +6,4 @@
...
@@ -6,13 +6,4 @@
<
startup
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.7.2"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.7.2"
/>
</
startup
>
</
startup
>
<
entityFramework
>
<
providers
>
<
provider
invariantName
=
"System.Data.SqlClient"
type
=
"System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"
/>
<
provider
invariantName
=
"System.Data.SQLite.EF6"
type
=
"System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"
/>
<
provider
invariantName
=
"System.Data.SQLite"
type
=
"System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"
/>
</
providers
>
</
entityFramework
>
</
configuration
>
</
configuration
>
\ No newline at end of file
TourDataManager/Db.cs
View file @
6c89ad6c
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
using
System.ComponentModel.DataAnnotations.Schema
;
using
System.Data.Common
;
using
System.Data.Common
;
...
@@ -39,7 +40,7 @@ namespace TourDataManager {
...
@@ -39,7 +40,7 @@ namespace TourDataManager {
protected
override
void
OnModelCreating
(
DbModelBuilder
modelBuilder
){
protected
override
void
OnModelCreating
(
DbModelBuilder
modelBuilder
){
modelBuilder
.
Entity
<
Foo
>();
//
modelBuilder.Entity<Foo>();
var
sqliteConnectionInitializer
=
new
SqliteCreateDatabaseIfNotExists
<
MyDbContext
>(
modelBuilder
);
var
sqliteConnectionInitializer
=
new
SqliteCreateDatabaseIfNotExists
<
MyDbContext
>(
modelBuilder
);
Database
.
SetInitializer
(
sqliteConnectionInitializer
);
Database
.
SetInitializer
(
sqliteConnectionInitializer
);
}
}
...
@@ -56,7 +57,7 @@ namespace TourDataManager {
...
@@ -56,7 +57,7 @@ namespace TourDataManager {
using
(
var
sqLiteConnection
=
new
System
.
Data
.
SQLite
.
SQLiteConnection
(
"data source=mylovelybase.sqlite"
)){
using
(
var
sqLiteConnection
=
new
System
.
Data
.
SQLite
.
SQLiteConnection
(
"data source=mylovelybase.sqlite"
)){
using
(
var
db
=
new
MyDbContext
(
sqLiteConnection
,
true
)){
using
(
var
db
=
new
MyDbContext
(
sqLiteConnection
,
true
)){
db
.
Foo
.
Add
(
new
Foo
{
Id
=
8
,
Data
=
"Yolo"
});
db
.
Foo
.
Add
(
new
Foo
{
Id
=
new
Random
().
Next
(
0
,
1000
)
,
Data
=
"Yolo"
});
db
.
SaveChanges
();
db
.
SaveChanges
();
//db.Set<Foo>()
//db.Set<Foo>()
...
...
TourDataManager/EF6CodeConfig.cs
deleted
100644 → 0
View file @
0750ea4b
using
System.Data.Entity
;
using
System.Data.Entity.Core.Common
;
using
System.Data.Entity.Infrastructure
;
using
System.Data.SQLite.EF6
;
namespace
TourDataManager
{
//public class Ef6CodeConfig : DbConfiguration {
// protected internal Ef6CodeConfig(){
// SetProviderFactory("System.Data.SQLite.EF6", SQLiteProviderFactory.Instance);
// SetProviderServices("System.Data.SQLite", (DbProviderServices)SQLiteProviderFactory.Instance.GetService(typeof(DbProviderServices)));
// }
//}
}
\ No newline at end of file
TourDataManager/Entities/Estate.cs
0 → 100644
View file @
6c89ad6c
namespace
TourDataManager.Entities
{
public
class
Estate
{
/// Идентификатор объекта недвижимости
public
long
Id
{
get
;
set
;
}
public
string
Title
{
get
;
set
;
}
public
int
TourCount
{
get
;
set
;
}
//cnt_tours
public
string
Preview
{
get
;
set
;
}
public
string
Created
{
get
;
set
;
}
}
}
\ No newline at end of file
TourDataManager/Entities/Tour.cs
0 → 100644
View file @
6c89ad6c
namespace
TourDataManager.Entities
{
public
class
Tour
{
public
long
Id
{
get
;
set
;
}
public
string
Title
{
get
;
set
;
}
public
string
Preview
{
get
;
set
;
}
public
string
Screen
{
get
;
set
;
}
public
int
EstateId
{
get
;
set
;
}
public
string
Created
{
get
;
set
;
}
public
string
Updated
{
get
;
set
;
}
public
string
Type
{
get
;
set
;
}
/// Состояние тура
public
int
State
{
get
;
set
;
}
}
}
\ No newline at end of file
TourDataManager/TourDataManager.csproj
View file @
6c89ad6c
...
@@ -103,7 +103,8 @@
...
@@ -103,7 +103,8 @@
<Compile
Include=
"CookieStorage.cs"
/>
<Compile
Include=
"CookieStorage.cs"
/>
<Compile
Include=
"Db.cs"
/>
<Compile
Include=
"Db.cs"
/>
<Compile
Include=
"Debug.cs"
/>
<Compile
Include=
"Debug.cs"
/>
<Compile
Include=
"EF6CodeConfig.cs"
/>
<Compile
Include=
"Entities\Estate.cs"
/>
<Compile
Include=
"Entities\Tour.cs"
/>
<Compile
Include=
"IAuthenticator.cs"
/>
<Compile
Include=
"IAuthenticator.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"TourDataManager.cs"
/>
<Compile
Include=
"TourDataManager.cs"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment