last fixes on make StringProvider Works ...
This commit is contained in:
@@ -164,8 +164,7 @@ namespace xStringService.Controllerppa
|
||||
);
|
||||
|
||||
//
|
||||
return Ok(result.
|
||||
ToDynamicObject());
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -102,13 +102,12 @@ namespace xStringService.Providers
|
||||
}
|
||||
|
||||
//
|
||||
XStringDto entity = null;
|
||||
XString entity = null;
|
||||
if (language.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
entity = await Repository
|
||||
.FindOneAsync(e => e.ResourceTitle == resource)
|
||||
.ToDynamicObject();
|
||||
.FindOneAsync(e => e.ResourceTitle == resource);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -116,8 +115,7 @@ namespace xStringService.Providers
|
||||
entity = await Repository
|
||||
.FindOneAsync(e => e.ResourceTitle == resource &&
|
||||
e.Language.ToNormalString() == language.ToNormalString()
|
||||
)
|
||||
.ToDynamicObject();
|
||||
);
|
||||
}
|
||||
result = !entity.IsNullOrDefault();
|
||||
|
||||
@@ -173,8 +171,7 @@ namespace xStringService.Providers
|
||||
}
|
||||
|
||||
//
|
||||
return entity
|
||||
.ToDynamicObject();
|
||||
return entity.ToXStringDto();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -390,23 +387,33 @@ namespace xStringService.Providers
|
||||
}
|
||||
|
||||
//
|
||||
XQueryResult<XStringDto> result = null;
|
||||
XQueryResult<XString> entityResult = null;
|
||||
if (language.IsNullOrEmpty())
|
||||
{
|
||||
//
|
||||
result = (await Repository.QueryAsync(query))
|
||||
.ToDynamicObject();
|
||||
entityResult = await Repository.QueryAsync(query);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
result = (await Repository.ConditionalQueryAsync(
|
||||
entityResult = await Repository.ConditionalQueryAsync(
|
||||
e => e.Language.ToNormalString() == language.ToNormalString(),
|
||||
query
|
||||
))
|
||||
.ToDynamicObject();
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
var result = new XQueryResult<XStringDto>
|
||||
{
|
||||
Page = entityResult.Page,
|
||||
PageSize = entityResult.PageSize,
|
||||
TotalPages = entityResult.TotalPages,
|
||||
TotalItems = entityResult.TotalItems,
|
||||
TotalFilteredPages = entityResult.TotalFilteredPages,
|
||||
TotalFilteredItems = entityResult.TotalFilteredItems,
|
||||
Items = entityResult.Items.Select(i => i.ToXStringDto()),
|
||||
};
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -530,8 +537,17 @@ namespace xStringService.Providers
|
||||
}
|
||||
|
||||
//
|
||||
var result = (await Repository.ConditionalQueryAsync(condition, query))
|
||||
.ToDynamicObject();
|
||||
var entityResult = await Repository.ConditionalQueryAsync(condition, query);
|
||||
var result = new XQueryResult<XStringDto>
|
||||
{
|
||||
Page = entityResult.Page,
|
||||
PageSize = entityResult.PageSize,
|
||||
TotalPages = entityResult.TotalPages,
|
||||
TotalItems = entityResult.TotalItems,
|
||||
TotalFilteredPages = entityResult.TotalFilteredPages,
|
||||
TotalFilteredItems = entityResult.TotalFilteredItems,
|
||||
Items = entityResult.Items.Select(i => i.ToXStringDto()),
|
||||
};
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -772,7 +788,7 @@ namespace xStringService.Providers
|
||||
}
|
||||
|
||||
//
|
||||
return result.ToDynamicObject();
|
||||
return result.ToXStringDto();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -835,7 +851,7 @@ namespace xStringService.Providers
|
||||
}
|
||||
|
||||
//
|
||||
XStringDto result = entity.ToDynamicObject();
|
||||
XStringDto result = entity.ToXStringDto();
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -998,7 +1014,7 @@ namespace xStringService.Providers
|
||||
}
|
||||
|
||||
//
|
||||
XStringDto result = entity.ToDynamicObject();
|
||||
XStringDto result = entity.ToXStringDto();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user