我正在研究Laravel中的存储库设计模式,并且正在使用https://github.com/andersao/l5-repository做到这一点。
我认为我在项目中取得了成功。但是当我使用存储库运行代码时,我遇到了一些问题
SQLSTATE [42S02]:找不到基本表或视图:1146表'test.nhanviens'不存在(SQL:select * from
nhanviens)
我数据库中的表是Nhanvien而不是Nhanviens
在我的代码中
NhanvienRepository.php
<?php
namespace App\Repositories;
use Prettus\Repository\Contracts\RepositoryInterface;
/**
* Interface NhanvienRepository
* @package namespace App\Repositories;
*/
interface NhanvienRepository extends RepositoryInterface
{
//
}
Run Code Online (Sandbox Code Playgroud)
NhanvienRepositoryEloquent.php
<?php
namespace App\Repositories;
use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Repositories\NhanvienRepository;
use App\Entities\Nhanvien;
use App\Validators\NhanvienValidator;
/**
* Class NhanvienRepositoryEloquent
* @package namespace App\Repositories;
*/
class NhanvienRepositoryEloquent extends BaseRepository implements NhanvienRepository
{
/**
* Specify Model class name
*
* @return string
*/
public function model()
{
return …Run Code Online (Sandbox Code Playgroud) 我正在研究Laravel 中的存储库设计模式,我正在使用https://github.com/andersao/l5-repository来完成它。
但是在我的项目中复制/粘贴文件夹 prettus 并将我的config/app.php Prettus\Repository\Providers\RepositoryServiceProvider::class 添加到 providers 数组的末尾后,我发现了一个问题:
Class 'Prettus\Repository\Providers\Repository ServiceProvider' not found
Run Code Online (Sandbox Code Playgroud)
之后,项目无法运行。请帮我。
谢谢
我尝试在调用方法中更改颜色文本 RickTextBox wpf。但是我遇到了一些麻烦。我的麻烦是
'SolidBrush' 参数类型对格式化属性 'Foreground' 无效。参数名称:值
我的代码
MethodInvoker action = delegate
{
TextRange textRange = new TextRange(RtTextProcess.Document.ContentStart, RtTextProcess.Document.ContentEnd);
if (txtColor == null) txtColor = Color.Black;
int start = textRange.Text.Length;
var txt = string.Concat(DateTime.Now.ToString(), " : ", text);
if (textRange.Text == "\r\n")
{
textRange.Text = "";
}
else
{
textRange.Text += txt.ToString();
}
TextPointer start1 = textRange.Start.GetPositionAtOffset(start, LogicalDirection.Forward);
TextPointer end = textRange.Start.GetPositionAtOffset(txt.Length, LogicalDirection.Backward);
if (start1 != null && end != null)
{
RtTextProcess.Selection.Select(start1, end);
}
// My error is here …Run Code Online (Sandbox Code Playgroud)