Skip to content

Adds ReadMe.md files to nuget packages #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions Extensions/Xtensive.Orm.BulkOperations/NugetContent/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Xtensive.Orm.BulkOperations
===========================

Summary
-------
The extension provides a set of IQueryable extension methods that are translated
to server-side UPDATE or DELETE commands.

Prerequisites
-------------
DataObjects.Net 6.0.x (http://dataobjects.net)


Examples of usage
-----------------

**Example #1**. Update primitive property with a constant value:

```csharp
session.Query.All<Bar>()
.Where(a => a.Id == 1)
.Set(a => a.Count, 2)
Update();
```

**Example #2** Updating persistent property with expression, computed on server:

```csharp
session.Query.All<Bar>()
.Where(a => a.Id==1)
.Set(a => a.Count, a => a.Description.Length)
.Update();
```

**Example #3**. Setting a reference to an entity that is already loaded into current Session

```csharp
// Emulating entity loading
var bar = session.Query.Single<Bar>(1);

session.Query.All<Foo>()
.Where(a => a.Id == 2)
.Set(a => a.Bar, bar)
.Update();
```

**Example #4**. Setting a reference to an entity that is not loaded into Session, 1st way

```csharp
session.Query.All<Foo>()
.Where(a => a.Id == 1)
.Set(a => a.Bar, a => Query.Single<Bar>(1))
.Update();
```

**Example #5**. Setting a reference to an entity that is not loaded into Session, 2nd way

```csharp
session.Query.All<Foo>()
.Where(a => a.Id == 1)
.Set(a => a.Bar, a => Query.All<Bar>().Single(b => b.Name == "test"))
.Update();
```

**Example #6**. Constructing update expressions of the fly

```csharp
bool condition = CheckCondition();
var query = session.Query.All()<Bar>
.Where(a => a.Id == 1)
.Set(a => a.Count, 2);

if(condition)
query = query.Set(a => a.Name, a => a.Name + "test");
query.Update();
```

**Example #7**. Updating lots of properties at once

```csharp
session.Query.All<Bar>()
.Where(a => a.Id == 1)
Update(
a => new Bar(null) { Count = 2, Name = a.Name + "test", /*dozens of other properties...*/ });
```

**Example #8**. Deleting entities

```csharp
session.Query.All<Foo>()
.Where(a => a.Id == 1)
.Delete();
```
83 changes: 0 additions & 83 deletions Extensions/Xtensive.Orm.BulkOperations/Readme.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Include="Readme.txt" />
<PropertyGroup Label="Nuget ReadMe" Condition="$(GeneratePackageOnBuild) == 'true'">
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup Label="Nuget content">
<Content Include="$(ProjectDir)NuGetContent\**">
<PackagePath>.</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
=========================
Xtensive.Orm.Localization
=========================

Expand All @@ -9,35 +8,14 @@ This implies that localizable resources are a part of domain model so they are s

Prerequisites
-------------
DataObjects.Net Core 0.1 or later (http://dataobjects.net)
DataObjects.Net 6.0.x or later (http://dataobjects.net)

Implementation
--------------
1. Add reference to Xtensive.Orm.Localization assembly
2. Include types from Xtensive.Orm.Localization assembly into the domain:

<Xtensive.Orm>
<domains>
<domain ... >
<types>
<add assembly="your assembly"/>
<add assembly="Xtensive.Orm.Localization"/>
</types>
</domain>
</domains>
</Xtensive.Orm>

2.1 Optionally add default localization configuration
<configSections>
<section name="Xtensive.Orm.Localization" type="Xtensive.Orm.Localization.Configuration.ConfigurationSection, Xtensive.Orm.Localization"/>
</configSections>

<Xtensive.Orm.Localization>
<defaultCulture name="es-ES"/>
</Xtensive.Orm.Localization>

3. Implement ILocalizable<TLocalization> on your localizable entities, e.g.:

Implement ILocalizable<TLocalization> on your localizable entities, e.g.:

```csharp
[HierarchyRoot]
public class Page : Entity, ILocalizable<PageLocalization>
{
Expand All @@ -56,9 +34,11 @@ Implementation

public Page(Session session) : base(session) {}
}
```

4. Define corresponding localizations, e.g.:
Define corresponding localizations, e.g.:

```csharp
[HierarchyRoot]
public class PageLocalization : Localization<Page>
{
Expand All @@ -68,42 +48,53 @@ Implementation
public PageLocalization(Session session, CultureInfo culture, Page target)
: base(session, culture, target) {}
}
```

Examples of usage
-----------------

Demo
----
1. Access localizable properties as regular ones, e.g.:
**Example #1**. Access localizable properties as regular ones, e.g.:

```csharp
page.Title = "Welcome";
string title = page.Title;
```

2. Mass editing of localizable properties:
**Example #2**. Mass editing of localizable properties:

```csharp
var en = new CultureInfo("en-US");
var sp = new CultureInfo("es-ES");
var page = new Page(session);
page.Localizations[en].Title = "Welcome";
page.Localizations[sp].Title = "Bienvenido";
```

3. Value of localizable properties reflects culture of the current Thread, e.g.:
**Example #3**. Value of localizable properties reflects culture of the current Thread, e.g.:

```csharp
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
string title = page.Title; // title is "Welcome"

Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES");
string title = page.Title; // title is "Bienvenido"
```

4. Instead of altering CurrentThread, instance of LocalizationScope can be used, e.g.:
**Example #4**. Instead of altering CurrentThread, instance of LocalizationScope can be used, e.g.:

```csharp
using (new LocalizationScope(new CultureInfo("en-US"))) {
string title = page.Title; // title is "Welcome"
}

using (new LocalizationScope(new CultureInfo("es-ES"))) {
string title = page.Title; // title is "Bienvenido"
}
```

5. LINQ queries that include localizable properties are transparently translated
**Example #5**. LINQ queries that include localizable properties are transparently translated

```csharp
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
var query = from p in session.Query.All<Page>()
where p.Title=="Welcome"
Expand All @@ -115,8 +106,4 @@ Demo
where p.Title=="Bienvenido"
select p;
Assert.AreEqual(1, query.Count());


References
----------
http://doextensions.codeplex.com
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Label="Nuget ReadMe" Condition="$(GeneratePackageOnBuild) == 'true'">
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
</PropertyGroup>
<Import Project="..\..\MSBuild\DataObjects.Net.InternalBuild.targets" />
<ItemGroup>
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Readme.txt" />
<ItemGroup Label="Nuget content">
<Content Include="$(ProjectDir)NuGetContent\**">
<PackagePath>.</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
51 changes: 51 additions & 0 deletions Extensions/Xtensive.Orm.Logging.NLog/NugetContent/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Xtensive.Orm.Logging.NLog
=========================

Summary
-------
The extension provides integration points between DataObjects.Net internal logging system and NLog.

Prerequisites
-------------

DataObjects.Net 6.0.x (http://dataobjects.net)
NLog 4.5 or later (http://nlog-project.org)

Implementation
--------------

Set up log provider in Xtensive.Orm configuration section

```xml
<Xtensive.Orm>
<domains>
<domain ... >
</domain>
</domains>
<logging provider="Xtensive.Orm.Logging.NLog.LogProvider, Xtensive.Orm.Logging.NLog">
</Xtensive.Orm>
```

Configure NLog (https://github.com/nlog/nlog/wiki/Tutorial), e.g.:

```xml
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<targets>
<target name="console" xsi:type="Console" />
</targets>

<rules>
<logger name="Xtensive.Orm" minlevel="Debug" writeTo="console" />
</rules>
</nlog>
```

You can choose from the following predefined internal loggers:
- "Xtensive.Orm"
- "Xtensive.Orm.Upgrade"
- "Xtensive.Orm.Building"
- "Xtensive.Orm.Core"
- "Xtensive.Orm.Sql"
Loading