Действительно ли строки подключения Платформы Объекта могут снова использовать существующую строку подключения?

Вы можете использовать этот фрагмент, чтобы получить вибрацию.

   UIView.animate(withDuration: 3.0, delay: 0.0,
                   usingSpringWithDamping: 0.1,
                   initialSpringVelocity: 0.9,
                   options: [.curveEaseIn, .overrideInheritedCurve], animations: {

                   let rangeOfTag = (self.detailText.text as NSString)
                    .range(of: "satisfactorily")
                    let glyRange =    self.detailText.layoutManager.glyphRange(forCharacterRange: rangeOfTag, actualCharacterRange: nil)
                    let rect =     self.detailText.layoutManager.lineFragmentRect(forGlyphAt: NSMaxRange(glyRange), effectiveRange: nil)
                self.detailText.scrollRectToVisible(rect, animated: false)



    }, completion: nil)
5
задан Paul Stovell 26 March 2009 в 03:15
поделиться

2 ответа

Я думаю, что лучший подход должен был бы осуществить рефакторинг приложение для использования всего одной строки подключения вместо того, чтобы пробовать к ссылочной от другого в конфигурационном файле.

1
ответ дан 18 December 2019 в 09:53
поделиться

I know this post is a bit old, but I figure this will help someone out there:

You can use the EntityConnectionStringBuilder to build your EF connection from your existing connection string. This is a sample I'm using in my own code:

public static string GetEntityFrameworkConnectionString(string clientConnectionString)
{
    EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder();
    entityBuilder.Provider = "System.Data.SqlClient";
    entityBuilder.ProviderConnectionString = clientConnectionString;
    entityBuilder.Metadata = "res://*/Entities.UBTEntities.csdl|res://*/Entities.UBTEntities.ssdl|res://*/Entities.UBTEntities.msl";
    return entityBuilder.ToString();
}

So when you instantiate your EF provider, just pass in the string returned from the method above into the constructor.

Hope this helps.

16
ответ дан 18 December 2019 в 09:53
поделиться
Другие вопросы по тегам:

Похожие вопросы: